Hazelcast C++ Client
Hazelcast C++ Client Library
hazelcast::client::config::client_aws_config Class Reference

The client_aws_config contains the configuration for client to connect to nodes in aws environment. More...

#include <client_aws_config.h>

Public Member Functions

const std::string & get_access_key () const
 Gets the access key to access AWS. More...
 
client_aws_configset_access_key (const std::string &access_key)
 Sets the access key to access AWS. More...
 
const std::string & get_secret_key () const
 Gets the secret key to access AWS. More...
 
client_aws_configset_secret_key (const std::string &secret_key)
 Sets the secret key to access AWS. More...
 
const std::string & get_region () const
 Gets the region where the EC2 instances running the Hazelcast members will be running. More...
 
client_aws_configset_region (const std::string &region)
 Sets the region where the EC2 instances running the Hazelcast members will be running. More...
 
const std::string & get_host_header () const
 Gets the host header; the address where the EC2 API can be found. More...
 
client_aws_configset_host_header (const std::string &host_header)
 Sets the host header; the address where the EC2 API can be found. More...
 
client_aws_configset_enabled (bool enabled)
 Enables or disables the aws join mechanism. More...
 
bool is_enabled () const
 Checks if the aws join mechanism is enabled. More...
 
client_aws_configset_security_group_name (const std::string &security_group_name)
 Sets the security group name. More...
 
const std::string & get_security_group_name () const
 Gets the security group name. More...
 
client_aws_configset_tag_key (const std::string &tag_key)
 Sets the tag key. More...
 
const std::string & get_tag_key () const
 Gets the tag key. More...
 
client_aws_configset_tag_value (const std::string &tag_value)
 Sets the tag value. More...
 
const std::string & get_tag_value () const
 Gets the tag value. More...
 
const std::string & get_iam_role () const
 Gets the iamRole name. More...
 
client_aws_configset_iam_role (const std::string &iam_role)
 Sets the tag value. More...
 
bool is_inside_aws () const
 If client is inside aws, it will use private ip addresses directly, otherwise it will convert private ip addresses to public addresses internally by calling AWS API. More...
 
client_aws_configset_inside_aws (bool inside_aws)
 Set to true if client is inside aws environment Default value is false. More...
 

Detailed Description

The client_aws_config contains the configuration for client to connect to nodes in aws environment.

The client_aws_config contains the configuration for AWS join mechanism.

what happens behind the scenes is that data about the running AWS instances in a specific region are downloaded using the accesskey/secretkey and are potential Hazelcast members.

Filtering

There are 2 mechanisms for filtering out AWS instances and these mechanisms can be combined (AND).

  1. If a securityGroup is configured, only instances within that security group are selected.
  2. If a tag key/value is set, only instances with that tag key/value will be selected.

Definition at line 53 of file client_aws_config.h.

Member Function Documentation

◆ get_access_key()

const std::string & hazelcast::client::config::client_aws_config::get_access_key ( ) const

Gets the access key to access AWS.

Returns empty string if no access key is configured.

Returns
the access key to access AWS
See also
#set_access_key(std::string)

Definition at line 595 of file config.cpp.

596 {
597  return access_key_;
598 }

◆ get_host_header()

const std::string & hazelcast::client::config::client_aws_config::get_host_header ( ) const

Gets the host header; the address where the EC2 API can be found.

Returns
the host header; the address where the EC2 API can be found

Definition at line 637 of file config.cpp.

638 {
639  return host_header_;
640 }

◆ get_iam_role()

const std::string & hazelcast::client::config::client_aws_config::get_iam_role ( ) const

Gets the iamRole name.

Returns
the iamRole. empty string if nothing is returned.
See also
#set_iam_role(std::string) (int32_t)

Definition at line 705 of file config.cpp.

706 {
707  return iam_role_;
708 }

◆ get_region()

const std::string & hazelcast::client::config::client_aws_config::get_region ( ) const

Gets the region where the EC2 instances running the Hazelcast members will be running.

Returns
the region where the EC2 instances running the Hazelcast members will be running
See also
#setRegion(std::string)

Definition at line 623 of file config.cpp.

624 {
625  return region_;
626 }

◆ get_secret_key()

const std::string & hazelcast::client::config::client_aws_config::get_secret_key ( ) const

Gets the secret key to access AWS.

Returns empty string if no access key is configured.

Returns
the secret key.
See also
#set_secret_key(std::string)

Definition at line 609 of file config.cpp.

610 {
611  return secret_key_;
612 }

◆ get_security_group_name()

const std::string & hazelcast::client::config::client_aws_config::get_security_group_name ( ) const

Gets the security group name.

If nothing has been configured, empty string is returned.

Returns
the security group name; empty string if nothing has been configured

Definition at line 673 of file config.cpp.

674 {
675  return security_group_name_;
676 }

◆ get_tag_key()

const std::string & hazelcast::client::config::client_aws_config::get_tag_key ( ) const

Gets the tag key.

If nothing is specified, empty string is returned.

Returns
the tag key. empty string if nothing is returned.

Definition at line 686 of file config.cpp.

687 {
688  return tag_key_;
689 }

◆ get_tag_value()

const std::string & hazelcast::client::config::client_aws_config::get_tag_value ( ) const

Gets the tag value.

If nothing is specified, empty string is returned.

Returns
the tag value. empty string if nothing is returned.

Definition at line 699 of file config.cpp.

700 {
701  return tag_value_;
702 }

◆ is_enabled()

bool hazelcast::client::config::client_aws_config::is_enabled ( ) const

Checks if the aws join mechanism is enabled.

Returns
true if enabled, false otherwise.

Definition at line 659 of file config.cpp.

660 {
661  return enabled_;
662 }

◆ is_inside_aws()

bool hazelcast::client::config::client_aws_config::is_inside_aws ( ) const

If client is inside aws, it will use private ip addresses directly, otherwise it will convert private ip addresses to public addresses internally by calling AWS API.

Returns
bool true if client is inside aws environment.

Definition at line 718 of file config.cpp.

719 {
720  return inside_aws_;
721 }

◆ set_access_key()

client_aws_config & hazelcast::client::config::client_aws_config::set_access_key ( const std::string &  access_key)

Sets the access key to access AWS.

Parameters
accessKeythe access key to access AWS
Returns
the updated client_aws_config.
Exceptions
illegal_argumentif accessKey is empty.
See also
#getAccessKey()
#set_secret_key(std::string)

Definition at line 601 of file config.cpp.

602 {
603  this->access_key_ = util::Preconditions::check_has_text(
604  access_key, "accessKey must contain text");
605  return *this;
606 }

◆ set_enabled()

client_aws_config & hazelcast::client::config::client_aws_config::set_enabled ( bool  enabled)

Enables or disables the aws join mechanism.

Parameters
enabledtrue if enabled, false otherwise.
Returns
the updated client_aws_config.

Definition at line 651 of file config.cpp.

652 {
653  util::Preconditions::check_ssl("get_aws_config");
654  this->enabled_ = enabled;
655  return *this;
656 }

◆ set_host_header()

client_aws_config & hazelcast::client::config::client_aws_config::set_host_header ( const std::string &  host_header)

Sets the host header; the address where the EC2 API can be found.

Parameters
hostHeaderthe new host header; the address where the EC2 API can be found
Returns
the updated client_aws_config
Exceptions
illegal_argumentif hostHeader is an empty string.

Definition at line 643 of file config.cpp.

644 {
645  this->host_header_ = util::Preconditions::check_has_text(
646  host_header, "hostHeader must contain text");
647  return *this;
648 }

◆ set_iam_role()

client_aws_config & hazelcast::client::config::client_aws_config::set_iam_role ( const std::string &  iam_role)

Sets the tag value.

See the filtering section above for more information.

Parameters
iamRolethe IAM Role name.
Returns
the updated client_aws_config.
See also
#getIamRole()

Definition at line 711 of file config.cpp.

712 {
713  this->iam_role_ = iam_role;
714  return *this;
715 }

◆ set_inside_aws()

client_aws_config & hazelcast::client::config::client_aws_config::set_inside_aws ( bool  inside_aws)

Set to true if client is inside aws environment Default value is false.

Parameters
insideAwsisInsideAws

Definition at line 724 of file config.cpp.

725 {
726  this->inside_aws_ = inside_aws;
727  return *this;
728 }

◆ set_region()

client_aws_config & hazelcast::client::config::client_aws_config::set_region ( const std::string &  region)

Sets the region where the EC2 instances running the Hazelcast members will be running.

Parameters
regionthe region where the EC2 instances running the Hazelcast members will be running
Returns
the updated client_aws_config
Exceptions
illegal_argumentif region is empty.

Definition at line 629 of file config.cpp.

630 {
631  this->region_ =
632  util::Preconditions::check_has_text(region, "region must contain text");
633  return *this;
634 }

◆ set_secret_key()

client_aws_config & hazelcast::client::config::client_aws_config::set_secret_key ( const std::string &  secret_key)

Sets the secret key to access AWS.

Parameters
secretKeythe secret key to access AWS
Returns
the updated client_aws_config.
Exceptions
illegal_argumentif secretKey is empty.
See also
#getSecretKey()
#set_access_key(std::string)

Definition at line 615 of file config.cpp.

616 {
617  this->secret_key_ = util::Preconditions::check_has_text(
618  secret_key, "secretKey must contain text");
619  return *this;
620 }

◆ set_security_group_name()

client_aws_config & hazelcast::client::config::client_aws_config::set_security_group_name ( const std::string &  security_group_name)

Sets the security group name.

See the filtering section above for more information.

Parameters
securityGroupNamethe security group name.
Returns
the updated client_aws_config.
See also
#getSecurityGroupName()

Definition at line 665 of file config.cpp.

667 {
668  this->security_group_name_ = security_group_name;
669  return *this;
670 }

◆ set_tag_key()

client_aws_config & hazelcast::client::config::client_aws_config::set_tag_key ( const std::string &  tag_key)

Sets the tag key.

See the filtering section above for more information.

Parameters
tagKeythe tag key. See the filtering section above for more information.
Returns
the updated client_aws_config.
See also
#set_tag_key(std::string)

Definition at line 679 of file config.cpp.

680 {
681  this->tag_key_ = tag_key;
682  return *this;
683 }

◆ set_tag_value()

client_aws_config & hazelcast::client::config::client_aws_config::set_tag_value ( const std::string &  tag_value)

Sets the tag value.

See the filtering section above for more information.

Parameters
tagValuethe tag value. See the filtering section above for more information.
Returns
the updated client_aws_config.
See also
#set_tag_key(std::string)
#getTagValue()

Definition at line 692 of file config.cpp.

693 {
694  this->tag_value_ = tag_value;
695  return *this;
696 }

The documentation for this class was generated from the following files: