ExAws v1.1.4 ExAws.Cloudformation View Source
Operations on Cloudformation
Basic Usage
alias ExAws.Cloudformation
# Create a stack with name with parameters
Cloudformation.create_stack("name",
[parameters:
[
[parameter_key: "AvailabilityZone", parameter_value: "us-east-1"],
[parameter_key: "InstanceType", parameter_value: "m1.micro"]
]]) |> ExAws.request!
# Delete a stack
Cloudformation.delete_stack("name", [role_arn: "aws:iam::blah:role/god"])
|> ExAws.request(region: "us-east-1")
General notes
All options are handled as underscore_atoms instead of camelcased binaries as specified in the CloudFormation API, I.E ‘:role_arn’ would be ‘RoleARN’.
http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_Operations.html
Link to this section Summary
Functions
Cancels an update on the specified stack
Rollbacks a stack in UPDATE_ROLLBACK_FAILED state until the state changes to UPDATE_ROLLBACK_COMPLETE state
Creates a stack as specified in a template
Deletes a stack
Describes a specified stack’s resource. Resource of the stack is specified by a logical record ID
Describes specified stack’s resources. You either have to specify a stack name or a physical resource ID
Returns the description for the specified stack; if no stack name was specified, then it returns the description for all the stacks created
Gets the template body for a specified stack. Can get a template for running or deleted stacks
Gets information about a new or existing template. Useful for viewing parameter information, such as default parameter values and parameter types
Lists summary of all of the resources for a specified stack
Gets the summary information for stacks. If no :stack_status_filters are passed in, then all stacks are returned (existing and stacks have have been deleted in the last 90 days)
Link to this section Types
continue_update_rollback_opts() :: [role_arn: binary, skip_resources: [binary, ...]]
create_stack_opts() :: [capabilities: [binary, ...], disable_rollback: boolean, notification_arns: [binary, ...], on_failure: binary, parameters: [parameter, ...], resource_types: [binary, ...], role_arn: binary, stack_policy_body: binary, stack_policy_url: binary, tags: [tag, ...], template_body: binary, template_url: binary, timeout_in_minutes: integer]
delete_stack_opts() :: [retain_resources: [binary, ...], role_arn: binary]
describe_stack_resources_opts() :: [stack_name: binary, logical_resource_id: binary, physical_resource_id: binary]
describe_stacks_opts() :: [stack_name: binary, next_token: binary]
get_template_opts() :: [change_set_name: binary, stack_name: binary, template_stage: [:original | :processed]]
get_template_summary_opts() :: [stack_name: binary, template_body: binary, template_url: binary]
list_stacks_opts() :: [next_token: binary, stack_status_filters: [ExAws.Cloudformation.Parsers.stack_status, ...]]
parameter() :: [parameter_key: binary, parameter_value: binary, use_previous_value: boolean]
Link to this section Functions
cancel_update_stack(stack_name :: binary) :: ExAws.Operation.Query.t
Cancels an update on the specified stack.
Please read: http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_CancelUpdateStack.html
Examples:
Cloudformation.cancel_update_stack("Test")
continue_update_rollback(stack_name :: binary, opts :: continue_update_rollback_opts) :: ExAws.Operation.Query.t
Rollbacks a stack in UPDATE_ROLLBACK_FAILED state until the state changes to UPDATE_ROLLBACK_COMPLETE state.
Please read: http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_ContinueUpdateRollback.html
Examples:
Cloudformation.continue_update_rollback("Test", [role_arn: "aws:iam:test"])
Cloudformation.continue_update_rollback("test_stack", [skip_resources: ["test_resource_1", "test_resource_2"]])
Cloudformation.continue_update_rollback("test_stack", [role_arn: "arn:my:thing", skip_resources: ["test_resource_1", "test_resource_2"]]
create_stack(stack_name :: binary, opts :: create_stack_opts) :: ExAws.Operation.Query.t
Creates a stack as specified in a template.
Please read: http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_CreateStack.html
Examples:
# Create stack from a template url
Cloudformation.create_stack("stack_name", [template_url: "https://s3.amazonaws.com/sample.json"])
# Create stack with parameters
Cloudformation.create_stack("test_stack",
[parameters: [[parameter_key: "AvailabilityZone", parameter_value: "us-east-1a"],
[parameter_key: "InstanceType", parameter_value: "m1.micro"]]])
delete_stack(stack_name :: binary, opts :: delete_stack_opts) :: ExAws.Operation.Query.t
Deletes a stack
Please read: http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_DeleteStack.html
Examples:
# Deletes a stack
Cloudformation.delete_stack("stack_name")
# Deletes a stack by stack name with a RoleARN
Cloudformation.delete_stack("stack_name", [role_arn: "aws:iam:123456:role/test"])
# Deletes a stack except for a couple of resources
Cloudformation.delete_stack("stack_name", [retain_resources: ["test_resource_1", "test_resource_2"]])
describe_stack_resource(stack_name :: binary, logical_resource_id :: binary) :: ExAws.Operation.Query.t
Describes a specified stack’s resource. Resource of the stack is specified by a logical record ID.
Please read: http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_DescribeStackResource.html
Examples:
Cloudformation.describe_stack_resource("Test", "logical_resource_Id")
describe_stack_resources(opts :: describe_stack_resources_opts) :: ExAws.Operation.Query.t
Describes specified stack’s resources. You either have to specify a stack name or a physical resource ID.
Please read: http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_DescribeStackResources.html
Example:
# Describe resources by stack name
Cloudformation.describe_stack_resources([stack_name: "Test"])
# Describe resources with a logical resource ID
Cloudformation.describe_stack_resources([stack_name: "Test", logical_resource_id: "test_resource_id"])
# Describe resources with a physical resource ID
Cloudformation.describe_stack_resources([physical_resource_id: "test_resource_id"])
describe_stacks(opts :: describe_stacks_opts) :: ExAws.Operation.Query.t
Returns the description for the specified stack; if no stack name was specified, then it returns the description for all the stacks created.
Please read: http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_DescribeStacks.html
Examples:
# Get all stacks
Cloudformation.describe_stacks
# Get a stack called "Test"
Cloudformation.describe_stacks([stack_name: "Test"])
get_template(opts :: get_template_opts) :: ExAws.Operation.Query.t
Gets the template body for a specified stack. Can get a template for running or deleted stacks.
Please read: http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_GetTemplate.html
Example:
# Get a template with stack name and template stage param
Cloudformation.get_template([stack_name: "Test", template_stage: :processed])
get_template_summary(opts :: get_template_summary_opts) :: ExAws.Operation.Query.t
Gets information about a new or existing template. Useful for viewing parameter information, such as default parameter values and parameter types
Please read: http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_GetTemplateSummary.html
Example
Get template summary with stack name
Cloudformation.get_template_summary([stack_name: “Test”])
list_stack_resources(stack_name :: binary, opts :: [{:next_token, binary}]) :: ExAws.Operation.Query.t
Lists summary of all of the resources for a specified stack
Please read: http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_ListStackResources.html
Examples:
Cloudformation.list_stack_resources("test_stack")
Cloudformation.list_stack_resources("test_stack", [next_token: "token"])
list_stacks(opts :: list_stacks_opts) :: ExAws.Operation.Query.t
Gets the summary information for stacks. If no :stack_status_filters are passed in, then all stacks are returned (existing and stacks have have been deleted in the last 90 days)
Please read: http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_ListStacks.html
Examples:
# List all stacks
Cloudformation.list_stacks
# List stacks with some stack status filters
Cloudformation.list_stacks([stack_status_filters: [:delete_complete]])