Skip to content
This repository has been archived by the owner on Oct 17, 2024. It is now read-only.

Commit

Permalink
fix(schema): CloudFormation Updates (#353)
Browse files Browse the repository at this point in the history
Co-authored-by: Paul Maddox <[email protected]>
  • Loading branch information
github-actions[bot] and PaulMaddox authored Mar 8, 2021
1 parent 420e5ec commit eee9123
Show file tree
Hide file tree
Showing 76 changed files with 17,594 additions and 4,850 deletions.
2 changes: 1 addition & 1 deletion cloudformation/acmpca/aws-acmpca-certificate_validity.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type Certificate_Validity struct {
// Value AWS CloudFormation Property
// Required: true
// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-acmpca-certificate-validity.html#cfn-acmpca-certificate-validity-value
Value int `json:"Value"`
Value float64 `json:"Value"`

// AWSCloudFormationDeletionPolicy represents a CloudFormation DeletionPolicy
AWSCloudFormationDeletionPolicy policies.DeletionPolicy `json:"-"`
Expand Down
551 changes: 551 additions & 0 deletions cloudformation/all.go

Large diffs are not rendered by default.

40 changes: 40 additions & 0 deletions cloudformation/athena/aws-athena-workgroup_engineversion.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package athena

import (
"github.com/awslabs/goformation/v4/cloudformation/policies"
)

// WorkGroup_EngineVersion AWS CloudFormation Resource (AWS::Athena::WorkGroup.EngineVersion)
// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-athena-workgroup-engineversion.html
type WorkGroup_EngineVersion struct {

// EffectiveEngineVersion AWS CloudFormation Property
// Required: false
// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-athena-workgroup-engineversion.html#cfn-athena-workgroup-engineversion-effectiveengineversion
EffectiveEngineVersion string `json:"EffectiveEngineVersion,omitempty"`

// SelectedEngineVersion AWS CloudFormation Property
// Required: false
// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-athena-workgroup-engineversion.html#cfn-athena-workgroup-engineversion-selectedengineversion
SelectedEngineVersion string `json:"SelectedEngineVersion,omitempty"`

// AWSCloudFormationDeletionPolicy represents a CloudFormation DeletionPolicy
AWSCloudFormationDeletionPolicy policies.DeletionPolicy `json:"-"`

// AWSCloudFormationUpdateReplacePolicy represents a CloudFormation UpdateReplacePolicy
AWSCloudFormationUpdateReplacePolicy policies.UpdateReplacePolicy `json:"-"`

// AWSCloudFormationDependsOn stores the logical ID of the resources to be created before this resource
AWSCloudFormationDependsOn []string `json:"-"`

// AWSCloudFormationMetadata stores structured data associated with this resource
AWSCloudFormationMetadata map[string]interface{} `json:"-"`

// AWSCloudFormationCondition stores the logical ID of the condition that must be satisfied for this resource to be created
AWSCloudFormationCondition string `json:"-"`
}

// AWSCloudFormationType returns the AWS CloudFormation resource type
func (r *WorkGroup_EngineVersion) AWSCloudFormationType() string {
return "AWS::Athena::WorkGroup.EngineVersion"
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ type WorkGroup_WorkGroupConfiguration struct {
// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-athena-workgroup-workgroupconfiguration.html#cfn-athena-workgroup-workgroupconfiguration-enforceworkgroupconfiguration
EnforceWorkGroupConfiguration bool `json:"EnforceWorkGroupConfiguration,omitempty"`

// EngineVersion AWS CloudFormation Property
// Required: false
// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-athena-workgroup-workgroupconfiguration.html#cfn-athena-workgroup-workgroupconfiguration-engineversion
EngineVersion *WorkGroup_EngineVersion `json:"EngineVersion,omitempty"`

// PublishCloudWatchMetricsEnabled AWS CloudFormation Property
// Required: false
// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-athena-workgroup-workgroupconfiguration.html#cfn-athena-workgroup-workgroupconfiguration-publishcloudwatchmetricsenabled
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ type WorkGroup_WorkGroupConfigurationUpdates struct {
// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-athena-workgroup-workgroupconfigurationupdates.html#cfn-athena-workgroup-workgroupconfigurationupdates-enforceworkgroupconfiguration
EnforceWorkGroupConfiguration bool `json:"EnforceWorkGroupConfiguration,omitempty"`

// EngineVersion AWS CloudFormation Property
// Required: false
// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-athena-workgroup-workgroupconfigurationupdates.html#cfn-athena-workgroup-workgroupconfigurationupdates-engineversion
EngineVersion *WorkGroup_EngineVersion `json:"EngineVersion,omitempty"`

// PublishCloudWatchMetricsEnabled AWS CloudFormation Property
// Required: false
// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-athena-workgroup-workgroupconfigurationupdates.html#cfn-athena-workgroup-workgroupconfigurationupdates-publishcloudwatchmetricsenabled
Expand Down
2 changes: 1 addition & 1 deletion cloudformation/backup/aws-backup-backupvault.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ type BackupVault struct {
// BackupVaultTags AWS CloudFormation Property
// Required: false
// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-backup-backupvault.html#cfn-backup-backupvault-backupvaulttags
BackupVaultTags interface{} `json:"BackupVaultTags,omitempty"`
BackupVaultTags map[string]string `json:"BackupVaultTags,omitempty"`

// EncryptionKeyArn AWS CloudFormation Property
// Required: false
Expand Down
5 changes: 5 additions & 0 deletions cloudformation/cloud9/aws-cloud9-environmentec2.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ type EnvironmentEC2 struct {
// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloud9-environmentec2.html#cfn-cloud9-environmentec2-description
Description string `json:"Description,omitempty"`

// ImageId AWS CloudFormation Property
// Required: false
// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloud9-environmentec2.html#cfn-cloud9-environmentec2-imageid
ImageId string `json:"ImageId,omitempty"`

// InstanceType AWS CloudFormation Property
// Required: true
// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloud9-environmentec2.html#cfn-cloud9-environmentec2-instancetype
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type ModuleVersion struct {
ModuleName string `json:"ModuleName,omitempty"`

// ModulePackage AWS CloudFormation Property
// Required: false
// Required: true
// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-moduleversion.html#cfn-cloudformation-moduleversion-modulepackage
ModulePackage string `json:"ModulePackage,omitempty"`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ type ReportGroup_S3ReportExportConfig struct {
// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-reportgroup-s3reportexportconfig.html#cfn-codebuild-reportgroup-s3reportexportconfig-bucket
Bucket string `json:"Bucket,omitempty"`

// BucketOwner AWS CloudFormation Property
// Required: false
// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-reportgroup-s3reportexportconfig.html#cfn-codebuild-reportgroup-s3reportexportconfig-bucketowner
BucketOwner string `json:"BucketOwner,omitempty"`

// EncryptionDisabled AWS CloudFormation Property
// Required: false
// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-reportgroup-s3reportexportconfig.html#cfn-codebuild-reportgroup-s3reportexportconfig-encryptiondisabled
Expand Down
5 changes: 5 additions & 0 deletions cloudformation/databrew/aws-databrew-dataset.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ import (
// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-databrew-dataset.html
type Dataset struct {

// Format AWS CloudFormation Property
// Required: false
// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-databrew-dataset.html#cfn-databrew-dataset-format
Format string `json:"Format,omitempty"`

// FormatOptions AWS CloudFormation Property
// Required: false
// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-databrew-dataset.html#cfn-databrew-dataset-formatoptions
Expand Down
5 changes: 5 additions & 0 deletions cloudformation/detective/aws-detective-memberinvitation.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ import (
// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-detective-memberinvitation.html
type MemberInvitation struct {

// DisableEmailNotification AWS CloudFormation Property
// Required: false
// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-detective-memberinvitation.html#cfn-detective-memberinvitation-disableemailnotification
DisableEmailNotification bool `json:"DisableEmailNotification,omitempty"`

// GraphArn AWS CloudFormation Property
// Required: true
// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-detective-memberinvitation.html#cfn-detective-memberinvitation-grapharn
Expand Down
117 changes: 117 additions & 0 deletions cloudformation/ec2/aws-ec2-transitgatewayconnect.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
package ec2

import (
"bytes"
"encoding/json"
"fmt"

"github.com/awslabs/goformation/v4/cloudformation/policies"
"github.com/awslabs/goformation/v4/cloudformation/tags"
)

// TransitGatewayConnect AWS CloudFormation Resource (AWS::EC2::TransitGatewayConnect)
// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-transitgatewayconnect.html
type TransitGatewayConnect struct {

// Options AWS CloudFormation Property
// Required: true
// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-transitgatewayconnect.html#cfn-ec2-transitgatewayconnect-options
Options *TransitGatewayConnect_TransitGatewayConnectOptions `json:"Options,omitempty"`

// Tags AWS CloudFormation Property
// Required: false
// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-transitgatewayconnect.html#cfn-ec2-transitgatewayconnect-tags
Tags []tags.Tag `json:"Tags,omitempty"`

// TransportTransitGatewayAttachmentId AWS CloudFormation Property
// Required: true
// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-transitgatewayconnect.html#cfn-ec2-transitgatewayconnect-transporttransitgatewayattachmentid
TransportTransitGatewayAttachmentId string `json:"TransportTransitGatewayAttachmentId,omitempty"`

// AWSCloudFormationDeletionPolicy represents a CloudFormation DeletionPolicy
AWSCloudFormationDeletionPolicy policies.DeletionPolicy `json:"-"`

// AWSCloudFormationUpdateReplacePolicy represents a CloudFormation UpdateReplacePolicy
AWSCloudFormationUpdateReplacePolicy policies.UpdateReplacePolicy `json:"-"`

// AWSCloudFormationDependsOn stores the logical ID of the resources to be created before this resource
AWSCloudFormationDependsOn []string `json:"-"`

// AWSCloudFormationMetadata stores structured data associated with this resource
AWSCloudFormationMetadata map[string]interface{} `json:"-"`

// AWSCloudFormationCondition stores the logical ID of the condition that must be satisfied for this resource to be created
AWSCloudFormationCondition string `json:"-"`
}

// AWSCloudFormationType returns the AWS CloudFormation resource type
func (r *TransitGatewayConnect) AWSCloudFormationType() string {
return "AWS::EC2::TransitGatewayConnect"
}

// MarshalJSON is a custom JSON marshalling hook that embeds this object into
// an AWS CloudFormation JSON resource's 'Properties' field and adds a 'Type'.
func (r TransitGatewayConnect) MarshalJSON() ([]byte, error) {
type Properties TransitGatewayConnect
return json.Marshal(&struct {
Type string
Properties Properties
DependsOn []string `json:"DependsOn,omitempty"`
Metadata map[string]interface{} `json:"Metadata,omitempty"`
DeletionPolicy policies.DeletionPolicy `json:"DeletionPolicy,omitempty"`
UpdateReplacePolicy policies.UpdateReplacePolicy `json:"UpdateReplacePolicy,omitempty"`
Condition string `json:"Condition,omitempty"`
}{
Type: r.AWSCloudFormationType(),
Properties: (Properties)(r),
DependsOn: r.AWSCloudFormationDependsOn,
Metadata: r.AWSCloudFormationMetadata,
DeletionPolicy: r.AWSCloudFormationDeletionPolicy,
UpdateReplacePolicy: r.AWSCloudFormationUpdateReplacePolicy,
Condition: r.AWSCloudFormationCondition,
})
}

// UnmarshalJSON is a custom JSON unmarshalling hook that strips the outer
// AWS CloudFormation resource object, and just keeps the 'Properties' field.
func (r *TransitGatewayConnect) UnmarshalJSON(b []byte) error {
type Properties TransitGatewayConnect
res := &struct {
Type string
Properties *Properties
DependsOn []string
Metadata map[string]interface{}
DeletionPolicy string
UpdateReplacePolicy string
Condition string
}{}

dec := json.NewDecoder(bytes.NewReader(b))
dec.DisallowUnknownFields() // Force error if unknown field is found

if err := dec.Decode(&res); err != nil {
fmt.Printf("ERROR: %s\n", err)
return err
}

// If the resource has no Properties set, it could be nil
if res.Properties != nil {
*r = TransitGatewayConnect(*res.Properties)
}
if res.DependsOn != nil {
r.AWSCloudFormationDependsOn = res.DependsOn
}
if res.Metadata != nil {
r.AWSCloudFormationMetadata = res.Metadata
}
if res.DeletionPolicy != "" {
r.AWSCloudFormationDeletionPolicy = policies.DeletionPolicy(res.DeletionPolicy)
}
if res.UpdateReplacePolicy != "" {
r.AWSCloudFormationUpdateReplacePolicy = policies.UpdateReplacePolicy(res.UpdateReplacePolicy)
}
if res.Condition != "" {
r.AWSCloudFormationCondition = res.Condition
}
return nil
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package ec2

import (
"github.com/awslabs/goformation/v4/cloudformation/policies"
)

// TransitGatewayConnect_TransitGatewayConnectOptions AWS CloudFormation Resource (AWS::EC2::TransitGatewayConnect.TransitGatewayConnectOptions)
// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-transitgatewayconnect-transitgatewayconnectoptions.html
type TransitGatewayConnect_TransitGatewayConnectOptions struct {

// Protocol AWS CloudFormation Property
// Required: false
// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-transitgatewayconnect-transitgatewayconnectoptions.html#cfn-ec2-transitgatewayconnect-transitgatewayconnectoptions-protocol
Protocol string `json:"Protocol,omitempty"`

// AWSCloudFormationDeletionPolicy represents a CloudFormation DeletionPolicy
AWSCloudFormationDeletionPolicy policies.DeletionPolicy `json:"-"`

// AWSCloudFormationUpdateReplacePolicy represents a CloudFormation UpdateReplacePolicy
AWSCloudFormationUpdateReplacePolicy policies.UpdateReplacePolicy `json:"-"`

// AWSCloudFormationDependsOn stores the logical ID of the resources to be created before this resource
AWSCloudFormationDependsOn []string `json:"-"`

// AWSCloudFormationMetadata stores structured data associated with this resource
AWSCloudFormationMetadata map[string]interface{} `json:"-"`

// AWSCloudFormationCondition stores the logical ID of the condition that must be satisfied for this resource to be created
AWSCloudFormationCondition string `json:"-"`
}

// AWSCloudFormationType returns the AWS CloudFormation resource type
func (r *TransitGatewayConnect_TransitGatewayConnectOptions) AWSCloudFormationType() string {
return "AWS::EC2::TransitGatewayConnect.TransitGatewayConnectOptions"
}
6 changes: 6 additions & 0 deletions cloudformation/ecr/aws-ecr-publicrepository.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"fmt"

"github.com/awslabs/goformation/v4/cloudformation/policies"
"github.com/awslabs/goformation/v4/cloudformation/tags"
)

// PublicRepository AWS CloudFormation Resource (AWS::ECR::PublicRepository)
Expand All @@ -27,6 +28,11 @@ type PublicRepository struct {
// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorypolicytext
RepositoryPolicyText interface{} `json:"RepositoryPolicyText,omitempty"`

// Tags AWS CloudFormation Property
// Required: false
// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-tags
Tags []tags.Tag `json:"Tags,omitempty"`

// AWSCloudFormationDeletionPolicy represents a CloudFormation DeletionPolicy
AWSCloudFormationDeletionPolicy policies.DeletionPolicy `json:"-"`

Expand Down
Loading

0 comments on commit eee9123

Please sign in to comment.