Upgrade AWS SDK to the latest version

This commit is contained in:
Andrey Smirnov
2017-09-28 17:57:05 +03:00
parent 9a767b7631
commit 182c21e38c
1096 changed files with 309697 additions and 132612 deletions
File diff suppressed because it is too large Load Diff
@@ -1,4 +1,4 @@
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
// Package cloudformationiface provides an interface to enable mocking the AWS CloudFormation service client
// for testing your code.
@@ -21,7 +21,7 @@ import (
//
// The best way to use this interface is so the SDK's service client's calls
// can be stubbed out for unit testing your code with the SDK without needing
// to inject custom request handlers into the the SDK's request pipeline.
// to inject custom request handlers into the SDK's request pipeline.
//
// // myFunc uses an SDK service client to make a request to
// // AWS CloudFormation.
@@ -76,6 +76,14 @@ type CloudFormationAPI interface {
CreateStackWithContext(aws.Context, *cloudformation.CreateStackInput, ...request.Option) (*cloudformation.CreateStackOutput, error)
CreateStackRequest(*cloudformation.CreateStackInput) (*request.Request, *cloudformation.CreateStackOutput)
CreateStackInstances(*cloudformation.CreateStackInstancesInput) (*cloudformation.CreateStackInstancesOutput, error)
CreateStackInstancesWithContext(aws.Context, *cloudformation.CreateStackInstancesInput, ...request.Option) (*cloudformation.CreateStackInstancesOutput, error)
CreateStackInstancesRequest(*cloudformation.CreateStackInstancesInput) (*request.Request, *cloudformation.CreateStackInstancesOutput)
CreateStackSet(*cloudformation.CreateStackSetInput) (*cloudformation.CreateStackSetOutput, error)
CreateStackSetWithContext(aws.Context, *cloudformation.CreateStackSetInput, ...request.Option) (*cloudformation.CreateStackSetOutput, error)
CreateStackSetRequest(*cloudformation.CreateStackSetInput) (*request.Request, *cloudformation.CreateStackSetOutput)
DeleteChangeSet(*cloudformation.DeleteChangeSetInput) (*cloudformation.DeleteChangeSetOutput, error)
DeleteChangeSetWithContext(aws.Context, *cloudformation.DeleteChangeSetInput, ...request.Option) (*cloudformation.DeleteChangeSetOutput, error)
DeleteChangeSetRequest(*cloudformation.DeleteChangeSetInput) (*request.Request, *cloudformation.DeleteChangeSetOutput)
@@ -84,6 +92,14 @@ type CloudFormationAPI interface {
DeleteStackWithContext(aws.Context, *cloudformation.DeleteStackInput, ...request.Option) (*cloudformation.DeleteStackOutput, error)
DeleteStackRequest(*cloudformation.DeleteStackInput) (*request.Request, *cloudformation.DeleteStackOutput)
DeleteStackInstances(*cloudformation.DeleteStackInstancesInput) (*cloudformation.DeleteStackInstancesOutput, error)
DeleteStackInstancesWithContext(aws.Context, *cloudformation.DeleteStackInstancesInput, ...request.Option) (*cloudformation.DeleteStackInstancesOutput, error)
DeleteStackInstancesRequest(*cloudformation.DeleteStackInstancesInput) (*request.Request, *cloudformation.DeleteStackInstancesOutput)
DeleteStackSet(*cloudformation.DeleteStackSetInput) (*cloudformation.DeleteStackSetOutput, error)
DeleteStackSetWithContext(aws.Context, *cloudformation.DeleteStackSetInput, ...request.Option) (*cloudformation.DeleteStackSetOutput, error)
DeleteStackSetRequest(*cloudformation.DeleteStackSetInput) (*request.Request, *cloudformation.DeleteStackSetOutput)
DescribeAccountLimits(*cloudformation.DescribeAccountLimitsInput) (*cloudformation.DescribeAccountLimitsOutput, error)
DescribeAccountLimitsWithContext(aws.Context, *cloudformation.DescribeAccountLimitsInput, ...request.Option) (*cloudformation.DescribeAccountLimitsOutput, error)
DescribeAccountLimitsRequest(*cloudformation.DescribeAccountLimitsInput) (*request.Request, *cloudformation.DescribeAccountLimitsOutput)
@@ -99,6 +115,10 @@ type CloudFormationAPI interface {
DescribeStackEventsPages(*cloudformation.DescribeStackEventsInput, func(*cloudformation.DescribeStackEventsOutput, bool) bool) error
DescribeStackEventsPagesWithContext(aws.Context, *cloudformation.DescribeStackEventsInput, func(*cloudformation.DescribeStackEventsOutput, bool) bool, ...request.Option) error
DescribeStackInstance(*cloudformation.DescribeStackInstanceInput) (*cloudformation.DescribeStackInstanceOutput, error)
DescribeStackInstanceWithContext(aws.Context, *cloudformation.DescribeStackInstanceInput, ...request.Option) (*cloudformation.DescribeStackInstanceOutput, error)
DescribeStackInstanceRequest(*cloudformation.DescribeStackInstanceInput) (*request.Request, *cloudformation.DescribeStackInstanceOutput)
DescribeStackResource(*cloudformation.DescribeStackResourceInput) (*cloudformation.DescribeStackResourceOutput, error)
DescribeStackResourceWithContext(aws.Context, *cloudformation.DescribeStackResourceInput, ...request.Option) (*cloudformation.DescribeStackResourceOutput, error)
DescribeStackResourceRequest(*cloudformation.DescribeStackResourceInput) (*request.Request, *cloudformation.DescribeStackResourceOutput)
@@ -107,6 +127,14 @@ type CloudFormationAPI interface {
DescribeStackResourcesWithContext(aws.Context, *cloudformation.DescribeStackResourcesInput, ...request.Option) (*cloudformation.DescribeStackResourcesOutput, error)
DescribeStackResourcesRequest(*cloudformation.DescribeStackResourcesInput) (*request.Request, *cloudformation.DescribeStackResourcesOutput)
DescribeStackSet(*cloudformation.DescribeStackSetInput) (*cloudformation.DescribeStackSetOutput, error)
DescribeStackSetWithContext(aws.Context, *cloudformation.DescribeStackSetInput, ...request.Option) (*cloudformation.DescribeStackSetOutput, error)
DescribeStackSetRequest(*cloudformation.DescribeStackSetInput) (*request.Request, *cloudformation.DescribeStackSetOutput)
DescribeStackSetOperation(*cloudformation.DescribeStackSetOperationInput) (*cloudformation.DescribeStackSetOperationOutput, error)
DescribeStackSetOperationWithContext(aws.Context, *cloudformation.DescribeStackSetOperationInput, ...request.Option) (*cloudformation.DescribeStackSetOperationOutput, error)
DescribeStackSetOperationRequest(*cloudformation.DescribeStackSetOperationInput) (*request.Request, *cloudformation.DescribeStackSetOperationOutput)
DescribeStacks(*cloudformation.DescribeStacksInput) (*cloudformation.DescribeStacksOutput, error)
DescribeStacksWithContext(aws.Context, *cloudformation.DescribeStacksInput, ...request.Option) (*cloudformation.DescribeStacksOutput, error)
DescribeStacksRequest(*cloudformation.DescribeStacksInput) (*request.Request, *cloudformation.DescribeStacksOutput)
@@ -142,10 +170,20 @@ type CloudFormationAPI interface {
ListExportsWithContext(aws.Context, *cloudformation.ListExportsInput, ...request.Option) (*cloudformation.ListExportsOutput, error)
ListExportsRequest(*cloudformation.ListExportsInput) (*request.Request, *cloudformation.ListExportsOutput)
ListExportsPages(*cloudformation.ListExportsInput, func(*cloudformation.ListExportsOutput, bool) bool) error
ListExportsPagesWithContext(aws.Context, *cloudformation.ListExportsInput, func(*cloudformation.ListExportsOutput, bool) bool, ...request.Option) error
ListImports(*cloudformation.ListImportsInput) (*cloudformation.ListImportsOutput, error)
ListImportsWithContext(aws.Context, *cloudformation.ListImportsInput, ...request.Option) (*cloudformation.ListImportsOutput, error)
ListImportsRequest(*cloudformation.ListImportsInput) (*request.Request, *cloudformation.ListImportsOutput)
ListImportsPages(*cloudformation.ListImportsInput, func(*cloudformation.ListImportsOutput, bool) bool) error
ListImportsPagesWithContext(aws.Context, *cloudformation.ListImportsInput, func(*cloudformation.ListImportsOutput, bool) bool, ...request.Option) error
ListStackInstances(*cloudformation.ListStackInstancesInput) (*cloudformation.ListStackInstancesOutput, error)
ListStackInstancesWithContext(aws.Context, *cloudformation.ListStackInstancesInput, ...request.Option) (*cloudformation.ListStackInstancesOutput, error)
ListStackInstancesRequest(*cloudformation.ListStackInstancesInput) (*request.Request, *cloudformation.ListStackInstancesOutput)
ListStackResources(*cloudformation.ListStackResourcesInput) (*cloudformation.ListStackResourcesOutput, error)
ListStackResourcesWithContext(aws.Context, *cloudformation.ListStackResourcesInput, ...request.Option) (*cloudformation.ListStackResourcesOutput, error)
ListStackResourcesRequest(*cloudformation.ListStackResourcesInput) (*request.Request, *cloudformation.ListStackResourcesOutput)
@@ -153,6 +191,18 @@ type CloudFormationAPI interface {
ListStackResourcesPages(*cloudformation.ListStackResourcesInput, func(*cloudformation.ListStackResourcesOutput, bool) bool) error
ListStackResourcesPagesWithContext(aws.Context, *cloudformation.ListStackResourcesInput, func(*cloudformation.ListStackResourcesOutput, bool) bool, ...request.Option) error
ListStackSetOperationResults(*cloudformation.ListStackSetOperationResultsInput) (*cloudformation.ListStackSetOperationResultsOutput, error)
ListStackSetOperationResultsWithContext(aws.Context, *cloudformation.ListStackSetOperationResultsInput, ...request.Option) (*cloudformation.ListStackSetOperationResultsOutput, error)
ListStackSetOperationResultsRequest(*cloudformation.ListStackSetOperationResultsInput) (*request.Request, *cloudformation.ListStackSetOperationResultsOutput)
ListStackSetOperations(*cloudformation.ListStackSetOperationsInput) (*cloudformation.ListStackSetOperationsOutput, error)
ListStackSetOperationsWithContext(aws.Context, *cloudformation.ListStackSetOperationsInput, ...request.Option) (*cloudformation.ListStackSetOperationsOutput, error)
ListStackSetOperationsRequest(*cloudformation.ListStackSetOperationsInput) (*request.Request, *cloudformation.ListStackSetOperationsOutput)
ListStackSets(*cloudformation.ListStackSetsInput) (*cloudformation.ListStackSetsOutput, error)
ListStackSetsWithContext(aws.Context, *cloudformation.ListStackSetsInput, ...request.Option) (*cloudformation.ListStackSetsOutput, error)
ListStackSetsRequest(*cloudformation.ListStackSetsInput) (*request.Request, *cloudformation.ListStackSetsOutput)
ListStacks(*cloudformation.ListStacksInput) (*cloudformation.ListStacksOutput, error)
ListStacksWithContext(aws.Context, *cloudformation.ListStacksInput, ...request.Option) (*cloudformation.ListStacksOutput, error)
ListStacksRequest(*cloudformation.ListStacksInput) (*request.Request, *cloudformation.ListStacksOutput)
@@ -168,14 +218,29 @@ type CloudFormationAPI interface {
SignalResourceWithContext(aws.Context, *cloudformation.SignalResourceInput, ...request.Option) (*cloudformation.SignalResourceOutput, error)
SignalResourceRequest(*cloudformation.SignalResourceInput) (*request.Request, *cloudformation.SignalResourceOutput)
StopStackSetOperation(*cloudformation.StopStackSetOperationInput) (*cloudformation.StopStackSetOperationOutput, error)
StopStackSetOperationWithContext(aws.Context, *cloudformation.StopStackSetOperationInput, ...request.Option) (*cloudformation.StopStackSetOperationOutput, error)
StopStackSetOperationRequest(*cloudformation.StopStackSetOperationInput) (*request.Request, *cloudformation.StopStackSetOperationOutput)
UpdateStack(*cloudformation.UpdateStackInput) (*cloudformation.UpdateStackOutput, error)
UpdateStackWithContext(aws.Context, *cloudformation.UpdateStackInput, ...request.Option) (*cloudformation.UpdateStackOutput, error)
UpdateStackRequest(*cloudformation.UpdateStackInput) (*request.Request, *cloudformation.UpdateStackOutput)
UpdateStackSet(*cloudformation.UpdateStackSetInput) (*cloudformation.UpdateStackSetOutput, error)
UpdateStackSetWithContext(aws.Context, *cloudformation.UpdateStackSetInput, ...request.Option) (*cloudformation.UpdateStackSetOutput, error)
UpdateStackSetRequest(*cloudformation.UpdateStackSetInput) (*request.Request, *cloudformation.UpdateStackSetOutput)
UpdateTerminationProtection(*cloudformation.UpdateTerminationProtectionInput) (*cloudformation.UpdateTerminationProtectionOutput, error)
UpdateTerminationProtectionWithContext(aws.Context, *cloudformation.UpdateTerminationProtectionInput, ...request.Option) (*cloudformation.UpdateTerminationProtectionOutput, error)
UpdateTerminationProtectionRequest(*cloudformation.UpdateTerminationProtectionInput) (*request.Request, *cloudformation.UpdateTerminationProtectionOutput)
ValidateTemplate(*cloudformation.ValidateTemplateInput) (*cloudformation.ValidateTemplateOutput, error)
ValidateTemplateWithContext(aws.Context, *cloudformation.ValidateTemplateInput, ...request.Option) (*cloudformation.ValidateTemplateOutput, error)
ValidateTemplateRequest(*cloudformation.ValidateTemplateInput) (*request.Request, *cloudformation.ValidateTemplateOutput)
WaitUntilChangeSetCreateComplete(*cloudformation.DescribeChangeSetInput) error
WaitUntilChangeSetCreateCompleteWithContext(aws.Context, *cloudformation.DescribeChangeSetInput, ...request.WaiterOption) error
WaitUntilStackCreateComplete(*cloudformation.DescribeStacksInput) error
WaitUntilStackCreateCompleteWithContext(aws.Context, *cloudformation.DescribeStacksInput, ...request.WaiterOption) error
+46
View File
@@ -0,0 +1,46 @@
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
// Package cloudformation provides the client and types for making API
// requests to AWS CloudFormation.
//
// AWS CloudFormation allows you to create and manage AWS infrastructure deployments
// predictably and repeatedly. You can use AWS CloudFormation to leverage AWS
// products, such as Amazon Elastic Compute Cloud, Amazon Elastic Block Store,
// Amazon Simple Notification Service, Elastic Load Balancing, and Auto Scaling
// to build highly-reliable, highly scalable, cost-effective applications without
// creating or 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 AWS CloudFormation, see the AWS CloudFormation
// Product Page (http://aws.amazon.com/cloudformation/).
//
// 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 docs.aws.amazon.com (http://docs.aws.amazon.com/).
//
// See https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15 for more information on this service.
//
// See cloudformation package documentation for more information.
// https://docs.aws.amazon.com/sdk-for-go/api/service/cloudformation/
//
// Using the Client
//
// To AWS CloudFormation with the SDK use the New function to create
// a new service client. With that client you can make API requests to the service.
// These clients are safe to use concurrently.
//
// See the SDK's documentation for more information on how to use the SDK.
// https://docs.aws.amazon.com/sdk-for-go/api/
//
// See aws.Config documentation for more information on configuring SDK clients.
// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config
//
// See the AWS CloudFormation client CloudFormation for more
// information on creating client for this service.
// https://docs.aws.amazon.com/sdk-for-go/api/service/cloudformation/#New
package cloudformation
+78 -6
View File
@@ -1,4 +1,4 @@
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package cloudformation
@@ -7,7 +7,7 @@ const (
// ErrCodeAlreadyExistsException for service response error code
// "AlreadyExistsException".
//
// Resource with the name requested already exists.
// The resource with the name requested already exists.
ErrCodeAlreadyExistsException = "AlreadyExistsException"
// ErrCodeChangeSetNotFoundException for service response error code
@@ -17,24 +17,96 @@ const (
// for a stack, use the ListChangeSets action.
ErrCodeChangeSetNotFoundException = "ChangeSetNotFound"
// ErrCodeCreatedButModifiedException for service response error code
// "CreatedButModifiedException".
//
// The specified resource exists, but has been changed.
ErrCodeCreatedButModifiedException = "CreatedButModifiedException"
// ErrCodeInsufficientCapabilitiesException for service response error code
// "InsufficientCapabilitiesException".
//
// The template contains resources with capabilities that were not specified
// The template contains resources with capabilities that weren't specified
// in the Capabilities parameter.
ErrCodeInsufficientCapabilitiesException = "InsufficientCapabilitiesException"
// ErrCodeInvalidChangeSetStatusException for service response error code
// "InvalidChangeSetStatus".
//
// The specified change set cannot be used to update the stack. For example,
// the change set status might be CREATE_IN_PROGRESS or the stack status might
// The specified change set can't be used to update the stack. For example,
// the change set status might be CREATE_IN_PROGRESS, or the stack status might
// be UPDATE_IN_PROGRESS.
ErrCodeInvalidChangeSetStatusException = "InvalidChangeSetStatus"
// ErrCodeInvalidOperationException for service response error code
// "InvalidOperationException".
//
// The specified operation isn't valid.
ErrCodeInvalidOperationException = "InvalidOperationException"
// ErrCodeLimitExceededException for service response error code
// "LimitExceededException".
//
// Quota for the resource has already been reached.
// The quota for the resource has already been reached.
//
// For information on stack set limitations, see Limitations of StackSets (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-limitations.html).
ErrCodeLimitExceededException = "LimitExceededException"
// ErrCodeNameAlreadyExistsException for service response error code
// "NameAlreadyExistsException".
//
// The specified name is already in use.
ErrCodeNameAlreadyExistsException = "NameAlreadyExistsException"
// ErrCodeOperationIdAlreadyExistsException for service response error code
// "OperationIdAlreadyExistsException".
//
// The specified operation ID already exists.
ErrCodeOperationIdAlreadyExistsException = "OperationIdAlreadyExistsException"
// ErrCodeOperationInProgressException for service response error code
// "OperationInProgressException".
//
// Another operation is currently in progress for this stack set. Only one operation
// can be performed for a stack set at a given time.
ErrCodeOperationInProgressException = "OperationInProgressException"
// ErrCodeOperationNotFoundException for service response error code
// "OperationNotFoundException".
//
// The specified ID refers to an operation that doesn't exist.
ErrCodeOperationNotFoundException = "OperationNotFoundException"
// ErrCodeStackInstanceNotFoundException for service response error code
// "StackInstanceNotFoundException".
//
// The specified stack instance doesn't exist.
ErrCodeStackInstanceNotFoundException = "StackInstanceNotFoundException"
// ErrCodeStackSetNotEmptyException for service response error code
// "StackSetNotEmptyException".
//
// You can't yet delete this stack set, because it still contains one or more
// stack instances. Delete all stack instances from the stack set before deleting
// the stack set.
ErrCodeStackSetNotEmptyException = "StackSetNotEmptyException"
// ErrCodeStackSetNotFoundException for service response error code
// "StackSetNotFoundException".
//
// The specified stack set doesn't exist.
ErrCodeStackSetNotFoundException = "StackSetNotFoundException"
// ErrCodeStaleRequestException for service response error code
// "StaleRequestException".
//
// Another operation has been performed on this stack set since the specified
// operation was performed.
ErrCodeStaleRequestException = "StaleRequestException"
// ErrCodeTokenAlreadyExistsException for service response error code
// "TokenAlreadyExistsException".
//
// A client request token already exists.
ErrCodeTokenAlreadyExistsException = "TokenAlreadyExistsException"
)
@@ -1,712 +0,0 @@
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
package cloudformation_test
import (
"bytes"
"fmt"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/cloudformation"
)
var _ time.Duration
var _ bytes.Buffer
func ExampleCloudFormation_CancelUpdateStack() {
sess := session.Must(session.NewSession())
svc := cloudformation.New(sess)
params := &cloudformation.CancelUpdateStackInput{
StackName: aws.String("StackName"), // Required
}
resp, err := svc.CancelUpdateStack(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleCloudFormation_ContinueUpdateRollback() {
sess := session.Must(session.NewSession())
svc := cloudformation.New(sess)
params := &cloudformation.ContinueUpdateRollbackInput{
StackName: aws.String("StackNameOrId"), // Required
ResourcesToSkip: []*string{
aws.String("ResourceToSkip"), // Required
// More values...
},
RoleARN: aws.String("RoleARN"),
}
resp, err := svc.ContinueUpdateRollback(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleCloudFormation_CreateChangeSet() {
sess := session.Must(session.NewSession())
svc := cloudformation.New(sess)
params := &cloudformation.CreateChangeSetInput{
ChangeSetName: aws.String("ChangeSetName"), // Required
StackName: aws.String("StackNameOrId"), // Required
Capabilities: []*string{
aws.String("Capability"), // Required
// More values...
},
ChangeSetType: aws.String("ChangeSetType"),
ClientToken: aws.String("ClientToken"),
Description: aws.String("Description"),
NotificationARNs: []*string{
aws.String("NotificationARN"), // Required
// More values...
},
Parameters: []*cloudformation.Parameter{
{ // Required
ParameterKey: aws.String("ParameterKey"),
ParameterValue: aws.String("ParameterValue"),
UsePreviousValue: aws.Bool(true),
},
// More values...
},
ResourceTypes: []*string{
aws.String("ResourceType"), // Required
// More values...
},
RoleARN: aws.String("RoleARN"),
Tags: []*cloudformation.Tag{
{ // Required
Key: aws.String("TagKey"),
Value: aws.String("TagValue"),
},
// More values...
},
TemplateBody: aws.String("TemplateBody"),
TemplateURL: aws.String("TemplateURL"),
UsePreviousTemplate: aws.Bool(true),
}
resp, err := svc.CreateChangeSet(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleCloudFormation_CreateStack() {
sess := session.Must(session.NewSession())
svc := cloudformation.New(sess)
params := &cloudformation.CreateStackInput{
StackName: aws.String("StackName"), // Required
Capabilities: []*string{
aws.String("Capability"), // Required
// More values...
},
DisableRollback: aws.Bool(true),
NotificationARNs: []*string{
aws.String("NotificationARN"), // Required
// More values...
},
OnFailure: aws.String("OnFailure"),
Parameters: []*cloudformation.Parameter{
{ // Required
ParameterKey: aws.String("ParameterKey"),
ParameterValue: aws.String("ParameterValue"),
UsePreviousValue: aws.Bool(true),
},
// More values...
},
ResourceTypes: []*string{
aws.String("ResourceType"), // Required
// More values...
},
RoleARN: aws.String("RoleARN"),
StackPolicyBody: aws.String("StackPolicyBody"),
StackPolicyURL: aws.String("StackPolicyURL"),
Tags: []*cloudformation.Tag{
{ // Required
Key: aws.String("TagKey"),
Value: aws.String("TagValue"),
},
// More values...
},
TemplateBody: aws.String("TemplateBody"),
TemplateURL: aws.String("TemplateURL"),
TimeoutInMinutes: aws.Int64(1),
}
resp, err := svc.CreateStack(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleCloudFormation_DeleteChangeSet() {
sess := session.Must(session.NewSession())
svc := cloudformation.New(sess)
params := &cloudformation.DeleteChangeSetInput{
ChangeSetName: aws.String("ChangeSetNameOrId"), // Required
StackName: aws.String("StackNameOrId"),
}
resp, err := svc.DeleteChangeSet(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleCloudFormation_DeleteStack() {
sess := session.Must(session.NewSession())
svc := cloudformation.New(sess)
params := &cloudformation.DeleteStackInput{
StackName: aws.String("StackName"), // Required
RetainResources: []*string{
aws.String("LogicalResourceId"), // Required
// More values...
},
RoleARN: aws.String("RoleARN"),
}
resp, err := svc.DeleteStack(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleCloudFormation_DescribeAccountLimits() {
sess := session.Must(session.NewSession())
svc := cloudformation.New(sess)
params := &cloudformation.DescribeAccountLimitsInput{
NextToken: aws.String("NextToken"),
}
resp, err := svc.DescribeAccountLimits(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleCloudFormation_DescribeChangeSet() {
sess := session.Must(session.NewSession())
svc := cloudformation.New(sess)
params := &cloudformation.DescribeChangeSetInput{
ChangeSetName: aws.String("ChangeSetNameOrId"), // Required
NextToken: aws.String("NextToken"),
StackName: aws.String("StackNameOrId"),
}
resp, err := svc.DescribeChangeSet(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleCloudFormation_DescribeStackEvents() {
sess := session.Must(session.NewSession())
svc := cloudformation.New(sess)
params := &cloudformation.DescribeStackEventsInput{
NextToken: aws.String("NextToken"),
StackName: aws.String("StackName"),
}
resp, err := svc.DescribeStackEvents(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleCloudFormation_DescribeStackResource() {
sess := session.Must(session.NewSession())
svc := cloudformation.New(sess)
params := &cloudformation.DescribeStackResourceInput{
LogicalResourceId: aws.String("LogicalResourceId"), // Required
StackName: aws.String("StackName"), // Required
}
resp, err := svc.DescribeStackResource(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleCloudFormation_DescribeStackResources() {
sess := session.Must(session.NewSession())
svc := cloudformation.New(sess)
params := &cloudformation.DescribeStackResourcesInput{
LogicalResourceId: aws.String("LogicalResourceId"),
PhysicalResourceId: aws.String("PhysicalResourceId"),
StackName: aws.String("StackName"),
}
resp, err := svc.DescribeStackResources(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleCloudFormation_DescribeStacks() {
sess := session.Must(session.NewSession())
svc := cloudformation.New(sess)
params := &cloudformation.DescribeStacksInput{
NextToken: aws.String("NextToken"),
StackName: aws.String("StackName"),
}
resp, err := svc.DescribeStacks(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleCloudFormation_EstimateTemplateCost() {
sess := session.Must(session.NewSession())
svc := cloudformation.New(sess)
params := &cloudformation.EstimateTemplateCostInput{
Parameters: []*cloudformation.Parameter{
{ // Required
ParameterKey: aws.String("ParameterKey"),
ParameterValue: aws.String("ParameterValue"),
UsePreviousValue: aws.Bool(true),
},
// More values...
},
TemplateBody: aws.String("TemplateBody"),
TemplateURL: aws.String("TemplateURL"),
}
resp, err := svc.EstimateTemplateCost(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleCloudFormation_ExecuteChangeSet() {
sess := session.Must(session.NewSession())
svc := cloudformation.New(sess)
params := &cloudformation.ExecuteChangeSetInput{
ChangeSetName: aws.String("ChangeSetNameOrId"), // Required
StackName: aws.String("StackNameOrId"),
}
resp, err := svc.ExecuteChangeSet(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleCloudFormation_GetStackPolicy() {
sess := session.Must(session.NewSession())
svc := cloudformation.New(sess)
params := &cloudformation.GetStackPolicyInput{
StackName: aws.String("StackName"), // Required
}
resp, err := svc.GetStackPolicy(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleCloudFormation_GetTemplate() {
sess := session.Must(session.NewSession())
svc := cloudformation.New(sess)
params := &cloudformation.GetTemplateInput{
ChangeSetName: aws.String("ChangeSetNameOrId"),
StackName: aws.String("StackName"),
TemplateStage: aws.String("TemplateStage"),
}
resp, err := svc.GetTemplate(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleCloudFormation_GetTemplateSummary() {
sess := session.Must(session.NewSession())
svc := cloudformation.New(sess)
params := &cloudformation.GetTemplateSummaryInput{
StackName: aws.String("StackNameOrId"),
TemplateBody: aws.String("TemplateBody"),
TemplateURL: aws.String("TemplateURL"),
}
resp, err := svc.GetTemplateSummary(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleCloudFormation_ListChangeSets() {
sess := session.Must(session.NewSession())
svc := cloudformation.New(sess)
params := &cloudformation.ListChangeSetsInput{
StackName: aws.String("StackNameOrId"), // Required
NextToken: aws.String("NextToken"),
}
resp, err := svc.ListChangeSets(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleCloudFormation_ListExports() {
sess := session.Must(session.NewSession())
svc := cloudformation.New(sess)
params := &cloudformation.ListExportsInput{
NextToken: aws.String("NextToken"),
}
resp, err := svc.ListExports(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleCloudFormation_ListImports() {
sess := session.Must(session.NewSession())
svc := cloudformation.New(sess)
params := &cloudformation.ListImportsInput{
ExportName: aws.String("ExportName"), // Required
NextToken: aws.String("NextToken"),
}
resp, err := svc.ListImports(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleCloudFormation_ListStackResources() {
sess := session.Must(session.NewSession())
svc := cloudformation.New(sess)
params := &cloudformation.ListStackResourcesInput{
StackName: aws.String("StackName"), // Required
NextToken: aws.String("NextToken"),
}
resp, err := svc.ListStackResources(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleCloudFormation_ListStacks() {
sess := session.Must(session.NewSession())
svc := cloudformation.New(sess)
params := &cloudformation.ListStacksInput{
NextToken: aws.String("NextToken"),
StackStatusFilter: []*string{
aws.String("StackStatus"), // Required
// More values...
},
}
resp, err := svc.ListStacks(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleCloudFormation_SetStackPolicy() {
sess := session.Must(session.NewSession())
svc := cloudformation.New(sess)
params := &cloudformation.SetStackPolicyInput{
StackName: aws.String("StackName"), // Required
StackPolicyBody: aws.String("StackPolicyBody"),
StackPolicyURL: aws.String("StackPolicyURL"),
}
resp, err := svc.SetStackPolicy(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleCloudFormation_SignalResource() {
sess := session.Must(session.NewSession())
svc := cloudformation.New(sess)
params := &cloudformation.SignalResourceInput{
LogicalResourceId: aws.String("LogicalResourceId"), // Required
StackName: aws.String("StackNameOrId"), // Required
Status: aws.String("ResourceSignalStatus"), // Required
UniqueId: aws.String("ResourceSignalUniqueId"), // Required
}
resp, err := svc.SignalResource(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleCloudFormation_UpdateStack() {
sess := session.Must(session.NewSession())
svc := cloudformation.New(sess)
params := &cloudformation.UpdateStackInput{
StackName: aws.String("StackName"), // Required
Capabilities: []*string{
aws.String("Capability"), // Required
// More values...
},
NotificationARNs: []*string{
aws.String("NotificationARN"), // Required
// More values...
},
Parameters: []*cloudformation.Parameter{
{ // Required
ParameterKey: aws.String("ParameterKey"),
ParameterValue: aws.String("ParameterValue"),
UsePreviousValue: aws.Bool(true),
},
// More values...
},
ResourceTypes: []*string{
aws.String("ResourceType"), // Required
// More values...
},
RoleARN: aws.String("RoleARN"),
StackPolicyBody: aws.String("StackPolicyBody"),
StackPolicyDuringUpdateBody: aws.String("StackPolicyDuringUpdateBody"),
StackPolicyDuringUpdateURL: aws.String("StackPolicyDuringUpdateURL"),
StackPolicyURL: aws.String("StackPolicyURL"),
Tags: []*cloudformation.Tag{
{ // Required
Key: aws.String("TagKey"),
Value: aws.String("TagValue"),
},
// More values...
},
TemplateBody: aws.String("TemplateBody"),
TemplateURL: aws.String("TemplateURL"),
UsePreviousTemplate: aws.Bool(true),
}
resp, err := svc.UpdateStack(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
func ExampleCloudFormation_ValidateTemplate() {
sess := session.Must(session.NewSession())
svc := cloudformation.New(sess)
params := &cloudformation.ValidateTemplateInput{
TemplateBody: aws.String("TemplateBody"),
TemplateURL: aws.String("TemplateURL"),
}
resp, err := svc.ValidateTemplate(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
+6 -22
View File
@@ -1,4 +1,4 @@
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package cloudformation
@@ -11,28 +11,12 @@ import (
"github.com/aws/aws-sdk-go/private/protocol/query"
)
// AWS CloudFormation allows you to create and manage AWS infrastructure deployments
// predictably and repeatedly. You can use AWS CloudFormation to leverage AWS
// products, such as Amazon Elastic Compute Cloud, Amazon Elastic Block Store,
// Amazon Simple Notification Service, Elastic Load Balancing, and Auto Scaling
// to build highly-reliable, highly scalable, cost-effective applications without
// creating or configuring the underlying AWS infrastructure.
// CloudFormation provides the API operation methods for making requests to
// AWS CloudFormation. See this package's package overview docs
// for details on the service.
//
// 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 AWS CloudFormation, see the AWS CloudFormation
// Product Page (http://aws.amazon.com/cloudformation/).
//
// Amazon CloudFormation makes use of other AWS products. For additional technical
// information about a specific AWS product, see its technical documentation
// (http://docs.aws.amazon.com/).
// The service client's operations are safe to be used concurrently.
// It is not safe to mutate any of the client's properties though.
// Please also see https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15
// CloudFormation methods are safe to use concurrently. It is not safe to
// modify mutate any of the struct's properties though.
type CloudFormation struct {
*client.Client
}
+85 -9
View File
@@ -1,4 +1,4 @@
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package cloudformation
@@ -9,9 +9,65 @@ import (
"github.com/aws/aws-sdk-go/aws/request"
)
// WaitUntilChangeSetCreateComplete uses the AWS CloudFormation API operation
// DescribeChangeSet to wait for a condition to be met before returning.
// If the condition is not met within the max attempt window, an error will
// be returned.
func (c *CloudFormation) WaitUntilChangeSetCreateComplete(input *DescribeChangeSetInput) error {
return c.WaitUntilChangeSetCreateCompleteWithContext(aws.BackgroundContext(), input)
}
// WaitUntilChangeSetCreateCompleteWithContext is an extended version of WaitUntilChangeSetCreateComplete.
// With the support for passing in a context and options to configure the
// Waiter and the underlying request options.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *CloudFormation) WaitUntilChangeSetCreateCompleteWithContext(ctx aws.Context, input *DescribeChangeSetInput, opts ...request.WaiterOption) error {
w := request.Waiter{
Name: "WaitUntilChangeSetCreateComplete",
MaxAttempts: 120,
Delay: request.ConstantWaiterDelay(30 * time.Second),
Acceptors: []request.WaiterAcceptor{
{
State: request.SuccessWaiterState,
Matcher: request.PathWaiterMatch, Argument: "Status",
Expected: "CREATE_COMPLETE",
},
{
State: request.FailureWaiterState,
Matcher: request.PathWaiterMatch, Argument: "Status",
Expected: "FAILED",
},
{
State: request.FailureWaiterState,
Matcher: request.ErrorWaiterMatch,
Expected: "ValidationError",
},
},
Logger: c.Config.Logger,
NewRequest: func(opts []request.Option) (*request.Request, error) {
var inCpy *DescribeChangeSetInput
if input != nil {
tmp := *input
inCpy = &tmp
}
req, _ := c.DescribeChangeSetRequest(inCpy)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return req, nil
},
}
w.ApplyOptions(opts...)
return w.WaitWithContext(ctx)
}
// WaitUntilStackCreateComplete uses the AWS CloudFormation API operation
// DescribeStacks to wait for a condition to be met before returning.
// If the condition is not meet within the max attempt window an error will
// If the condition is not met within the max attempt window, an error will
// be returned.
func (c *CloudFormation) WaitUntilStackCreateComplete(input *DescribeStacksInput) error {
return c.WaitUntilStackCreateCompleteWithContext(aws.BackgroundContext(), input)
@@ -69,7 +125,12 @@ func (c *CloudFormation) WaitUntilStackCreateCompleteWithContext(ctx aws.Context
},
Logger: c.Config.Logger,
NewRequest: func(opts []request.Option) (*request.Request, error) {
req, _ := c.DescribeStacksRequest(input)
var inCpy *DescribeStacksInput
if input != nil {
tmp := *input
inCpy = &tmp
}
req, _ := c.DescribeStacksRequest(inCpy)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return req, nil
@@ -82,7 +143,7 @@ func (c *CloudFormation) WaitUntilStackCreateCompleteWithContext(ctx aws.Context
// WaitUntilStackDeleteComplete uses the AWS CloudFormation API operation
// DescribeStacks to wait for a condition to be met before returning.
// If the condition is not meet within the max attempt window an error will
// If the condition is not met within the max attempt window, an error will
// be returned.
func (c *CloudFormation) WaitUntilStackDeleteComplete(input *DescribeStacksInput) error {
return c.WaitUntilStackDeleteCompleteWithContext(aws.BackgroundContext(), input)
@@ -140,7 +201,12 @@ func (c *CloudFormation) WaitUntilStackDeleteCompleteWithContext(ctx aws.Context
},
Logger: c.Config.Logger,
NewRequest: func(opts []request.Option) (*request.Request, error) {
req, _ := c.DescribeStacksRequest(input)
var inCpy *DescribeStacksInput
if input != nil {
tmp := *input
inCpy = &tmp
}
req, _ := c.DescribeStacksRequest(inCpy)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return req, nil
@@ -153,7 +219,7 @@ func (c *CloudFormation) WaitUntilStackDeleteCompleteWithContext(ctx aws.Context
// WaitUntilStackExists uses the AWS CloudFormation API operation
// DescribeStacks to wait for a condition to be met before returning.
// If the condition is not meet within the max attempt window an error will
// If the condition is not met within the max attempt window, an error will
// be returned.
func (c *CloudFormation) WaitUntilStackExists(input *DescribeStacksInput) error {
return c.WaitUntilStackExistsWithContext(aws.BackgroundContext(), input)
@@ -186,7 +252,12 @@ func (c *CloudFormation) WaitUntilStackExistsWithContext(ctx aws.Context, input
},
Logger: c.Config.Logger,
NewRequest: func(opts []request.Option) (*request.Request, error) {
req, _ := c.DescribeStacksRequest(input)
var inCpy *DescribeStacksInput
if input != nil {
tmp := *input
inCpy = &tmp
}
req, _ := c.DescribeStacksRequest(inCpy)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return req, nil
@@ -199,7 +270,7 @@ func (c *CloudFormation) WaitUntilStackExistsWithContext(ctx aws.Context, input
// WaitUntilStackUpdateComplete uses the AWS CloudFormation API operation
// DescribeStacks to wait for a condition to be met before returning.
// If the condition is not meet within the max attempt window an error will
// If the condition is not met within the max attempt window, an error will
// be returned.
func (c *CloudFormation) WaitUntilStackUpdateComplete(input *DescribeStacksInput) error {
return c.WaitUntilStackUpdateCompleteWithContext(aws.BackgroundContext(), input)
@@ -247,7 +318,12 @@ func (c *CloudFormation) WaitUntilStackUpdateCompleteWithContext(ctx aws.Context
},
Logger: c.Config.Logger,
NewRequest: func(opts []request.Option) (*request.Request, error) {
req, _ := c.DescribeStacksRequest(input)
var inCpy *DescribeStacksInput
if input != nil {
tmp := *input
inCpy = &tmp
}
req, _ := c.DescribeStacksRequest(inCpy)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return req, nil