in internal/pkg/deploy/cloudformation/changeset.go [118:140]
func createChangeSetInput(stackName, templateBody string, options ...createChangeSetOpt) (*cloudformation.CreateChangeSetInput, error) {
id, err := uuid.NewRandom()
if err != nil {
return nil, fmt.Errorf("failed to generate random id for changeSet: %w", err)
}
// The change set name must match the regex [a-zA-Z][-a-zA-Z0-9]*. The generated UUID can start with a number,
// by prefixing the uuid with a word we guarantee that we start with a letter.
name := fmt.Sprintf("%s-%s", "oam-ecs", id.String())
in := &cloudformation.CreateChangeSetInput{
Capabilities: aws.StringSlice([]string{
cloudformation.CapabilityCapabilityIam,
}),
ChangeSetName: aws.String(name),
StackName: aws.String(stackName),
TemplateBody: aws.String(templateBody),
}
for _, option := range options {
option(in)
}
return in, nil
}