AWS SDK Version 2 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

.NET Framework 4.5
 
Implementation for accessing CloudFormation AWS CloudFormation

AWS CloudFormation enables you to create and manage AWS infrastructure deployments predictably and repeatedly. AWS CloudFormation helps you leverage AWS products such as Amazon EC2, EBS, Amazon SNS, ELB, and Auto Scaling to build highly-reliable, highly scalable, cost effective applications without worrying about creating and configuring the underlying AWS infrastructure.

With AWS CloudFormation, you declare all of your resources and dependencies in a template file. The template defines a collection of resources as a single unit called a stack. AWS CloudFormation creates and deletes all member resources of the stack together and manages all dependencies between the resources for you.

For more information about this product, go to the CloudFormation Product Page.

Amazon CloudFormation makes use of other AWS products. If you need additional technical information about a specific AWS product, you can find the product's technical documentation at http://docs.aws.amazon.com/documentation/.

Inheritance Hierarchy

System.Object
  Amazon.Runtime.AmazonServiceClient
    Amazon.CloudFormation.AmazonCloudFormationClient

Namespace: Amazon.CloudFormation
Assembly: AWSSDK.dll
Version: (assembly version)

Syntax

C#
public class AmazonCloudFormationClient : AmazonServiceClient
         IAmazonCloudFormation, IDisposable

The AmazonCloudFormationClient type exposes the following members

Constructors

NameDescription
Public Method AmazonCloudFormationClient() Constructs AmazonCloudFormationClient with the credentials loaded from the application's default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance. Example App.config with credentials set.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <appSettings>
        <add key="AWSProfileName" value="AWS Default"/>
    </appSettings>
</configuration>
             
Public Method AmazonCloudFormationClient(RegionEndpoint) Constructs AmazonCloudFormationClient with the credentials loaded from the application's default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance. Example App.config with credentials set.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <appSettings>
        <add key="AWSProfileName" value="AWS Default"/>
    </appSettings>
</configuration>
             
Public Method AmazonCloudFormationClient(AmazonCloudFormationConfig) Constructs AmazonCloudFormationClient with the credentials loaded from the application's default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance. Example App.config with credentials set.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <appSettings>
        <add key="AWSProfileName" value="AWS Default"/>
    </appSettings>
</configuration>
             
Public Method AmazonCloudFormationClient(AWSCredentials) Constructs AmazonCloudFormationClient with AWS Credentials
Public Method AmazonCloudFormationClient(AWSCredentials, RegionEndpoint) Constructs AmazonCloudFormationClient with AWS Credentials
Public Method AmazonCloudFormationClient(AWSCredentials, AmazonCloudFormationConfig) Constructs AmazonCloudFormationClient with AWS Credentials and an AmazonCloudFormationClient Configuration object.
Public Method AmazonCloudFormationClient(string, string) Constructs AmazonCloudFormationClient with AWS Access Key ID and AWS Secret Key
Public Method AmazonCloudFormationClient(string, string, RegionEndpoint) Constructs AmazonCloudFormationClient with AWS Access Key ID and AWS Secret Key
Public Method AmazonCloudFormationClient(string, string, AmazonCloudFormationConfig) Constructs AmazonCloudFormationClient with AWS Access Key ID, AWS Secret Key and an AmazonCloudFormationClient Configuration object.
Public Method AmazonCloudFormationClient(string, string, string) Constructs AmazonCloudFormationClient with AWS Access Key ID and AWS Secret Key
Public Method AmazonCloudFormationClient(string, string, string, RegionEndpoint) Constructs AmazonCloudFormationClient with AWS Access Key ID and AWS Secret Key
Public Method AmazonCloudFormationClient(string, string, string, AmazonCloudFormationConfig) Constructs AmazonCloudFormationClient with AWS Access Key ID, AWS Secret Key and an AmazonCloudFormationClient Configuration object.

Methods

NameDescription
Public Method CancelUpdateStack(CancelUpdateStackRequest) Cancels an update on the specified stack. If the call completes successfully, the stack rolls back the update and reverts to the previous stack configuration. You can cancel only stacks that are in the UPDATE_IN_PROGRESS state.
Public Method CancelUpdateStackAsync(CancelUpdateStackRequest, CancellationToken) Initiates the asynchronous execution of the CancelUpdateStack operation.
Public Method ContinueUpdateRollback(ContinueUpdateRollbackRequest) For a specified stack that is in the UPDATE_ROLLBACK_FAILED state, continues rolling it back to the UPDATE_ROLLBACK_COMPLETE state. Depending on the cause of the failure, you can manually fix the error and continue the rollback. By continuing the rollback, you can return your stack to a working state (the UPDATE_ROLLBACK_COMPLETE state), and then try to update the stack again.

A stack goes into the UPDATE_ROLLBACK_FAILED state when AWS CloudFormation cannot roll back all changes after a failed stack update. For example, you might have a stack that is rolling back to an old database instance that was deleted outside of AWS CloudFormation. Because AWS CloudFormation doesn't know the database was deleted, it assumes that the database instance still exists and attempts to roll back to it, causing the update rollback to fail.

Public Method ContinueUpdateRollbackAsync(ContinueUpdateRollbackRequest, CancellationToken) Initiates the asynchronous execution of the ContinueUpdateRollback operation.
Public Method CreateStack(CreateStackRequest) Creates a stack as specified in the template. After the call completes successfully, the stack creation starts. You can check the status of the stack via the DescribeStacks API.
Public Method CreateStackAsync(CreateStackRequest, CancellationToken) Initiates the asynchronous execution of the CreateStack operation.
Public Method DeleteStack(DeleteStackRequest) Deletes a specified stack. Once the call completes successfully, stack deletion starts. Deleted stacks do not show up in the DescribeStacks API if the deletion has been completed successfully.
Public Method DeleteStackAsync(DeleteStackRequest, CancellationToken) Initiates the asynchronous execution of the DeleteStack operation.
Public Method DescribeAccountLimits(DescribeAccountLimitsRequest) Retrieves your account's AWS CloudFormation limits, such as the maximum number of stacks that you can create in your account.
Public Method DescribeAccountLimitsAsync(DescribeAccountLimitsRequest, CancellationToken) Initiates the asynchronous execution of the DescribeAccountLimits operation.
Public Method DescribeStackEvents(DescribeStackEventsRequest) Returns all stack related events for a specified stack. For more information about a stack's event history, go to Stacks in the AWS CloudFormation User Guide. You can list events for stacks that have failed to create or have been deleted by specifying the unique stack identifier (stack ID).
Public Method DescribeStackEventsAsync(DescribeStackEventsRequest, CancellationToken) Initiates the asynchronous execution of the DescribeStackEvents operation.
Public Method DescribeStackResource(DescribeStackResourceRequest) Returns a description of the specified resource in the specified stack.

For deleted stacks, DescribeStackResource returns resource information for up to 90 days after the stack has been deleted.

Public Method DescribeStackResourceAsync(DescribeStackResourceRequest, CancellationToken) Initiates the asynchronous execution of the DescribeStackResource operation.
Public Method DescribeStackResources(DescribeStackResourcesRequest) Returns AWS resource descriptions for running and deleted stacks. If StackName is specified, all the associated resources that are part of the stack are returned. If PhysicalResourceId is specified, the associated resources of the stack that the resource belongs to are returned. Only the first 100 resources will be returned. If your stack has more resources than this, you should use ListStackResources instead.

For deleted stacks, DescribeStackResources returns resource information for up to 90 days after the stack has been deleted.

You must specify either StackName or PhysicalResourceId, but not both. In addition, you can specify LogicalResourceId to filter the returned result. For more information about resources, the LogicalResourceId and PhysicalResourceId, go to the AWS CloudFormation User Guide.

A ValidationError is returned if you specify both StackName and PhysicalResourceId in the same request.
Public Method DescribeStackResourcesAsync(DescribeStackResourcesRequest, CancellationToken) Initiates the asynchronous execution of the DescribeStackResources operation.
Public Method DescribeStacks() Returns the description for the specified stack; if no stack name was specified, then it returns the description for all the stacks created.
Public Method DescribeStacks(DescribeStacksRequest) Returns the description for the specified stack; if no stack name was specified, then it returns the description for all the stacks created.
Public Method DescribeStacksAsync(DescribeStacksRequest, CancellationToken) Initiates the asynchronous execution of the DescribeStacks operation.
Public Method Dispose() Inherited from Amazon.Runtime.AmazonServiceClient.
Public Method EstimateTemplateCost(EstimateTemplateCostRequest) Returns the estimated monthly cost of a template. The return value is an AWS Simple Monthly Calculator URL with a query string that describes the resources required to run the template.
Public Method EstimateTemplateCostAsync(EstimateTemplateCostRequest, CancellationToken) Initiates the asynchronous execution of the EstimateTemplateCost operation.
Public Method GetStackPolicy(GetStackPolicyRequest) Returns the stack policy for a specified stack. If a stack doesn't have a policy, a null value is returned.
Public Method GetStackPolicyAsync(GetStackPolicyRequest, CancellationToken) Initiates the asynchronous execution of the GetStackPolicy operation.
Public Method GetTemplate(GetTemplateRequest) Returns the template body for a specified stack. You can get the template for running or deleted stacks.

For deleted stacks, GetTemplate returns the template for up to 90 days after the stack has been deleted.

If the template does not exist, a ValidationError is returned.
Public Method GetTemplateAsync(GetTemplateRequest, CancellationToken) Initiates the asynchronous execution of the GetTemplate operation.
Public Method GetTemplateSummary(GetTemplateSummaryRequest) Returns information about a new or existing template. The GetTemplateSummary action is useful for viewing parameter information, such as default parameter values and parameter types, before you create or update a stack.

You can use the GetTemplateSummary action when you submit a template, or you can get template information for a running or deleted stack.

For deleted stacks, GetTemplateSummary returns the template information for up to 90 days after the stack has been deleted. If the template does not exist, a ValidationError is returned.

Public Method GetTemplateSummaryAsync(GetTemplateSummaryRequest, CancellationToken) Initiates the asynchronous execution of the GetTemplateSummary operation.
Public Method ListStackResources(ListStackResourcesRequest) Returns descriptions of all resources of the specified stack.

For deleted stacks, ListStackResources returns resource information for up to 90 days after the stack has been deleted.

Public Method ListStackResourcesAsync(ListStackResourcesRequest, CancellationToken) Initiates the asynchronous execution of the ListStackResources operation.
Public Method ListStacks() Returns the summary information for stacks whose status matches the specified StackStatusFilter. Summary information for stacks that have been deleted is kept for 90 days after the stack is deleted. If no StackStatusFilter is specified, summary information for all stacks is returned (including existing stacks and stacks that have been deleted).
Public Method ListStacks(ListStacksRequest) Returns the summary information for stacks whose status matches the specified StackStatusFilter. Summary information for stacks that have been deleted is kept for 90 days after the stack is deleted. If no StackStatusFilter is specified, summary information for all stacks is returned (including existing stacks and stacks that have been deleted).
Public Method ListStacksAsync(ListStacksRequest, CancellationToken) Initiates the asynchronous execution of the ListStacks operation.
Public Method SetStackPolicy(SetStackPolicyRequest) Sets a stack policy for a specified stack.
Public Method SetStackPolicyAsync(SetStackPolicyRequest, CancellationToken) Initiates the asynchronous execution of the SetStackPolicy operation.
Public Method SignalResource(SignalResourceRequest) Sends a signal to the specified resource with a success or failure status. You can use the SignalResource API in conjunction with a creation policy or update policy. AWS CloudFormation doesn't proceed with a stack creation or update until resources receive the required number of signals or the timeout period is exceeded. The SignalResource API is useful in cases where you want to send signals from anywhere other than an Amazon EC2 instance.
Public Method SignalResourceAsync(SignalResourceRequest, CancellationToken) Initiates the asynchronous execution of the SignalResource operation.
Public Method UpdateStack(UpdateStackRequest) Updates a stack as specified in the template. After the call completes successfully, the stack update starts. You can check the status of the stack via the DescribeStacks action.

To get a copy of the template for an existing stack, you can use the GetTemplate action.

For more information about creating an update template, updating a stack, and monitoring the progress of the update, see Updating a Stack.

Public Method UpdateStackAsync(UpdateStackRequest, CancellationToken) Initiates the asynchronous execution of the UpdateStack operation.
Public Method ValidateTemplate() Validates a specified template.
Public Method ValidateTemplate(ValidateTemplateRequest) Validates a specified template.
Public Method ValidateTemplateAsync(ValidateTemplateRequest, CancellationToken) Initiates the asynchronous execution of the ValidateTemplate operation.

Events

NameDescription
Event AfterResponseEvent Inherited from Amazon.Runtime.AmazonServiceClient.
Event BeforeRequestEvent Inherited from Amazon.Runtime.AmazonServiceClient.
Event ExceptionEvent Inherited from Amazon.Runtime.AmazonServiceClient.

Version Information

.NET Framework:
Supported in: 4.5, 4.0, 3.5

.NET for Windows Store apps:
Supported in: Windows 8.1, Windows 8

.NET for Windows Phone:
Supported in: Windows Phone 8.1