ExAws.RedShift v0.1.0 ExAws.RedShift View Source

Operations on AWS RedShift.

Link to this section Summary

Functions

Create a new cluster with the given cluster id

Delete a RedShift cluster with the a given identifier

Describe the properties of the given cluster ID. If no cluster ID is given, a list of properties for all clusters is returned

A function for expanding a list of values for enumerable keys

Modify a cluster with a given ClusterIdentifier

Link to this section Types

Link to this type cluster_type() View Source
cluster_type() :: [:"multi-node" | :"single-node"]
Link to this type create_cluster_opts() View Source
create_cluster_opts() :: [cluster_identifier: binary(), master_username: binary(), master_user_password: binary(), node_type: node_type(), allow_version_upgrade: boolean(), automated_snapshot_retention_period: 0..35, availability_zone: binary(), cluster_parameter_group_name: binary(), cluster_security_groups: [binary()], cluster_subnet_group_name: binary(), cluster_type: cluster_type(), cluster_version: binary(), db_name: binary(), elastic_ip: binary(), encrypted: boolean(), enhanced_vpc_routing: :boolean, hsm_client_certificate_identifier: binary(), hsm_configuration_identifier: binary(), iam_roles: [binary()]]
Link to this type delete_cluster_opts() View Source
delete_cluster_opts() :: [cluster_identifier: binary(), final_cluster_snapshot_identifier: binary(), skip_final_cluster_snapshot: boolean()]
Link to this type describe_clusters_opts() View Source
describe_clusters_opts() :: [cluster_identifier: binary(), marker: binary(), max_records: 20..100, tag_keys: binary(), tag_values: binary()]
Link to this type modify_cluster_opts() View Source
modify_cluster_opts() :: [cluster_identifier: binary(), additional_info: binary(), allow_version_upgrade: boolean(), automated_snapshot_retention_period: 0..35, cluster_parameter_group_name: binary(), cluster_security_groups: [binary()], cluster_type: cluster_type(), cluster_version: binary(), elastic_ip: binary(), enhanced_vpc_routing: boolean(), hsm_client_certificate_identifier: binary(), hsm_onfiguration_identifier: binary(), master_user_password: binary(), new_cluster_identifier: binary(), node_type: node_type(), number_of_nodes: integer(), preferred_maintenance_window: binary(), publicly_accessible: boolean(), vpc_security_groups: [binary()]]
Link to this type node_type() View Source
node_type() :: [:"ds1.xlarge" | :"ds1.8xlarge" | :"ds2.xlarge" | :"ds2.8xlarge" | :"dc1.large" | :"dc1.8xlarge"]

Link to this section Functions

Create a new cluster with the given cluster id.

Required keys are cluster_identifier, master_username, master_user_password, and node_type.

Amazon docs: http://docs.aws.amazon.com/redshift/latest/APIReference/API_CreateCluster.html

Examples

iex> ExAws.RedShift.create_cluster("A2", [master_username: "Nier", master_user_password: "Automata", node_type: "dc1_large"])
%ExAws.Operation.Query{action: "CreateCluster",
  params: %{"Action" => "CreateCluster", "ClusterIdentifier" => "A2", "MasterUsername" => "Nier", "MasterUserPassword" => "Automata", "NodeType" => "dc1_large"},
  parser: &ExAws.Utils.identity/2, path: "/", service: :redshift}

iex> ExAws.RedShift.create_cluster("A2", [cluster_identifier: "21O", master_username: "Nier", master_user_password: "Automata", node_type: "dc1_large"])
%ExAws.Operation.Query{action: "CreateCluster",
  params: %{"Action" => "CreateCluster", "ClusterIdentifier" => "A2", "MasterUsername" => "Nier", "MasterUserPassword" => "Automata", "NodeType" => "dc1_large"},
  parser: &ExAws.Utils.identity/2, path: "/", service: :redshift}

iex> ExAws.RedShift.create_cluster([cluster_identifier: "2B", master_username: "Nier", master_user_password: "Automata", node_type: "dc1_large"])
%ExAws.Operation.Query{action: "CreateCluster",
  params: %{"Action" => "CreateCluster", "ClusterIdentifier" => "2B", "MasterUsername" => "Nier", "MasterUserPassword" => "Automata", "NodeType" => "dc1_large"},
  parser: &ExAws.Utils.identity/2, path: "/", service: :redshift}

Delete a RedShift cluster with the a given identifier.

Required key is cluster_identifier.

Amazon docs: http://docs.aws.amazon.com/redshift/latest/APIReference/API_DeleteCluster.html

Examples

iex> ExAws.RedShift.delete_cluster("2B", [])
%ExAws.Operation.Query{action: "DeleteCluster",
  params: %{"Action" => "DeleteCluster", "ClusterIdentifier" => "2B"},
  parser: &ExAws.Utils.identity/2, path: "/", service: :redshift}
Link to this function delete_cluster(id, opts \\ []) View Source
Link to this function describe_clusters(opts \\ []) View Source

Describe the properties of the given cluster ID. If no cluster ID is given, a list of properties for all clusters is returned.

Amazon docs: http://docs.aws.amazon.com/redshift/latest/APIReference/API_DescribeClusters.html

Examples

iex> ExAws.RedShift.describe_clusters([cluster_identifier: "2B"])
%ExAws.Operation.Query{action: "DescribeClusters",
  params: %{"Action" => "DescribeClusters", "ClusterIdentifier" => "2B"},
  parser: &ExAws.Utils.identity/2, path: "/", service: :redshift}

iex> ExAws.RedShift.describe_clusters([cluster_identifier: "2B", some_wrong_key: "Eve"])
%ExAws.Operation.Query{action: "DescribeClusters",
  params: %{"Action" => "DescribeClusters", "ClusterIdentifier" => "2B"},
  parser: &ExAws.Utils.identity/2, path: "/", service: :redshift}

iex> ExAws.RedShift.describe_clusters("A2", [])
%ExAws.Operation.Query{action: "DescribeClusters",
  params: %{"Action" => "DescribeClusters", "ClusterIdentifier" => "A2"},
  parser: &ExAws.Utils.identity/2, path: "/", service: :redshift}

iex> ExAws.RedShift.describe_clusters("9S", [cluster_identifier: "21O"])
%ExAws.Operation.Query{action: "DescribeClusters",
  params: %{"Action" => "DescribeClusters", "ClusterIdentifier" => "9S"},
  parser: &ExAws.Utils.identity/2, path: "/", service: :redshift}
Link to this function expand_params(item, separator \\ "/") View Source
expand_params(Tuple.t(), String.t()) :: List.t()

A function for expanding a list of values for enumerable keys.

Some AWS keys support multiple values like roles, security groups, or tags. The key usually follows the format Names.Name.<index>, for example, IamRoles.IamRoleArn.1 as seen in the examples below. The function takes the key and a list of values, then append numerical index to the key using the given separator and pair it with each value.

Examples

iex> ExAws.RedShift.expand_params({"iam_roles/_iam_role_arn", ["Operator", "Scanner"]})
[{"iam_roles/_iam_role_arn/1", "Operator"}, {"iam_roles/_iam_role_arn/2", "Scanner"}]

iex> ExAws.RedShift.expand_params({"IamRoles.IamRoleArn", ["Operator", "Scanner"]}, ".")
[{"IamRoles.IamRoleArn.1", "Operator"}, {"IamRoles.IamRoleArn.2", "Scanner"}]

iex> ExAws.RedShift.expand_params({"iam_roles/_iam_role_arn", []})
[]

Modify a cluster with a given ClusterIdentifier.

Required key is cluster_identifier.

Amazon docs: http://docs.aws.amazon.com/redshift/latest/APIReference/API_ModifyCluster.html

Examples

iex> ExAws.RedShift.modify_cluster("Adam", [])
%ExAws.Operation.Query{action: "ModifyCluster",
  params: %{"Action" => "ModifyCluster", "ClusterIdentifier" => "Adam"},
  parser: &ExAws.Utils.identity/2, path: "/", service: :redshift}

iex> ExAws.RedShift.modify_cluster("Adam", [new_cluster_identifier: "Eve"])
%ExAws.Operation.Query{action: "ModifyCluster",
  params: %{"Action" => "ModifyCluster", "ClusterIdentifier" => "Adam", "NewClusterIdentifier" => "Eve"},
  parser: &ExAws.Utils.identity/2, path: "/", service: :redshift}

iex> ExAws.RedShift.modify_cluster("Adam", [cluster_identifier: "Eve", cluster_security_groups: ["test", "tast"]])
%ExAws.Operation.Query{action: "ModifyCluster",
  params: %{"Action" => "ModifyCluster", "ClusterIdentifier" => "Adam", "ClusterSecurityGroups.ClusterSecurityGroupName.1" => "test", "ClusterSecurityGroups.ClusterSecurityGroupName.2" => "tast"},
  parser: &ExAws.Utils.identity/2, path: "/", service: :redshift}
Link to this function modify_cluster(id, opts \\ []) View Source
modify_cluster(String.t(), Keyword.t()) :: ExAws.Operation.Query.t()