Documentation ¶
Index ¶
- Variables
- func Autoinit() bool
- func ExtractConstructID(path *string) string
- func LogicalIDfromCID(stackContent *string, constructID *string) (*string, error)
- func PhysicalIDfromCID(client CloudFormationInterface, stack *string, constructId *string) (*string, error)
- func SetClient(c CloudFormationInterface)
- type CloudFormationInterface
- type CloudFormationInterfaceMock
- func (mock *CloudFormationInterfaceMock) DescribeStackResource(ctx context.Context, params *cloudformation.DescribeStackResourceInput, ...) (*cloudformation.DescribeStackResourceOutput, error)
- func (mock *CloudFormationInterfaceMock) DescribeStackResourceCalls() []struct{ ... }
- func (mock *CloudFormationInterfaceMock) GetTemplate(ctx context.Context, params *cloudformation.GetTemplateInput, ...) (*cloudformation.GetTemplateOutput, error)
- func (mock *CloudFormationInterfaceMock) GetTemplateCalls() []struct{ ... }
- type Resource
- type Resources
- type SimpleCfn
- type Template
Constants ¶
This section is empty.
Variables ¶
var AUTO_INIT bool
initialise clients
Functions ¶
func LogicalIDfromCID ¶
LogicalIDfromCID - get logicalID
func PhysicalIDfromCID ¶
func PhysicalIDfromCID(client CloudFormationInterface, stack *string, constructId *string) (*string, error)
PhysicalIDfromCID get AWS physical id from CDK contruct ID stack - Stackname constructID - awssns.NewTopic(stack, jsii.String("MyTopic") << MyTopic
func SetClient ¶ added in v0.1.12
func SetClient(c CloudFormationInterface)
Types ¶
type CloudFormationInterface ¶
type CloudFormationInterface interface { GetTemplate(ctx context.Context, params *cloudformation.GetTemplateInput, optFns ...func(*cloudformation.Options)) (*cloudformation.GetTemplateOutput, error) DescribeStackResource(ctx context.Context, params *cloudformation.DescribeStackResourceInput, optFns ...func(*cloudformation.Options)) (*cloudformation.DescribeStackResourceOutput, error) }
var CfnClient CloudFormationInterface
type CloudFormationInterfaceMock ¶ added in v0.1.13
type CloudFormationInterfaceMock struct { // DescribeStackResourceFunc mocks the DescribeStackResource method. DescribeStackResourceFunc func(ctx context.Context, params *cloudformation.DescribeStackResourceInput, optFns ...func(*cloudformation.Options)) (*cloudformation.DescribeStackResourceOutput, error) // GetTemplateFunc mocks the GetTemplate method. GetTemplateFunc func(ctx context.Context, params *cloudformation.GetTemplateInput, optFns ...func(*cloudformation.Options)) (*cloudformation.GetTemplateOutput, error) // contains filtered or unexported fields }
CloudFormationInterfaceMock is a mock implementation of CloudFormationInterface.
func TestSomethingThatUsesCloudFormationInterface(t *testing.T) { // make and configure a mocked CloudFormationInterface mockedCloudFormationInterface := &CloudFormationInterfaceMock{ DescribeStackResourceFunc: func(ctx context.Context, params *cloudformation.DescribeStackResourceInput, optFns ...func(*cloudformation.Options)) (*cloudformation.DescribeStackResourceOutput, error) { panic("mock out the DescribeStackResource method") }, GetTemplateFunc: func(ctx context.Context, params *cloudformation.GetTemplateInput, optFns ...func(*cloudformation.Options)) (*cloudformation.GetTemplateOutput, error) { panic("mock out the GetTemplate method") }, } // use mockedCloudFormationInterface in code that requires CloudFormationInterface // and then make assertions. }
func (*CloudFormationInterfaceMock) DescribeStackResource ¶ added in v0.1.13
func (mock *CloudFormationInterfaceMock) DescribeStackResource(ctx context.Context, params *cloudformation.DescribeStackResourceInput, optFns ...func(*cloudformation.Options)) (*cloudformation.DescribeStackResourceOutput, error)
DescribeStackResource calls DescribeStackResourceFunc.
func (*CloudFormationInterfaceMock) DescribeStackResourceCalls ¶ added in v0.1.13
func (mock *CloudFormationInterfaceMock) DescribeStackResourceCalls() []struct { Ctx context.Context Params *cloudformation.DescribeStackResourceInput OptFns []func(*cloudformation.Options) }
DescribeStackResourceCalls gets all the calls that were made to DescribeStackResource. Check the length with:
len(mockedCloudFormationInterface.DescribeStackResourceCalls())
func (*CloudFormationInterfaceMock) GetTemplate ¶ added in v0.1.13
func (mock *CloudFormationInterfaceMock) GetTemplate(ctx context.Context, params *cloudformation.GetTemplateInput, optFns ...func(*cloudformation.Options)) (*cloudformation.GetTemplateOutput, error)
GetTemplate calls GetTemplateFunc.
func (*CloudFormationInterfaceMock) GetTemplateCalls ¶ added in v0.1.13
func (mock *CloudFormationInterfaceMock) GetTemplateCalls() []struct { Ctx context.Context Params *cloudformation.GetTemplateInput OptFns []func(*cloudformation.Options) }
GetTemplateCalls gets all the calls that were made to GetTemplate. Check the length with:
len(mockedCloudFormationInterface.GetTemplateCalls())
type Resource ¶
type Resource struct {
Metadata map[string]interface{} `json:"Metadata,omitempty"`
}
type Template ¶
type Template struct { AWSTemplateFormatVersion string `json:"AWSTemplateFormatVersion,omitempty"` Description string `json:"Description,omitempty"` Metadata map[string]interface{} `json:"Metadata,omitempty"` Parameters map[string]interface{} `json:"Parameters,omitempty"` Rules map[string]interface{} `json:"Rules,omitempty"` Mappings map[string]interface{} `json:"Mappings,omitempty"` CDKMetadata map[string]interface{} `json:"CDKMetadata,omitempty"` Conditions map[string]interface{} `json:"Conditions,omitempty"` Transform map[string]interface{} `json:"Transform,omitempty"` Resources Resources `json:"Resources,omitempty"` Outputs map[string]interface{} `json:"Outputs,omitempty"` }
Template Content See https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html and https://github.com/awslabs/goformation/blob/d7193b5126b26a12ad1c810c7c481023cef849d8/cloudformation/template.go#L14