Skip to content

Commit

Permalink
feat(schema): CloudFormation Updates (2020-02-22) (awslabs#269)
Browse files Browse the repository at this point in the history
Updated the following AWS CloudFormation resources:

 - AWS::WAFv2::RuleGroup
 - AWS::Config::ConfigurationAggregator
 - AWS::WAFv2::IPSet
 - AWS::Cognito::UserPool
 - AWS::WAFv2::RegexPatternSet
 - AWS::CodeBuild::Project
 - AWS::Config::AggregationAuthorization
 - AWS::WAFv2::WebACL
 - AWS::WAFv2::WebACL.ExcludedRule
 - AWS::WAFv2::WebACL.SizeConstraintStatement
 - AWS::WAFv2::WebACL.IPSetReferenceStatement
 - AWS::WAFv2::RuleGroup.AndStatementOne
 - AWS::CodeBuild::Project.ProjectFileSystemLocation
 - AWS::WAFv2::WebACL.ManagedRuleGroupStatement
 - AWS::WAFv2::WebACL.OverrideAction
 - AWS::WAFv2::RuleGroup.XssMatchStatement
 - AWS::WAFv2::WebACL.AndStatementOne
 - AWS::WAFv2::RuleGroup.SqliMatchStatement
 - AWS::WAFv2::RuleGroup.SizeConstraintStatement
 - AWS::WAFv2::WebACL.DefaultAction
 - AWS::WAFv2::RuleGroup.RegexPatternSetReferenceStatement
 - AWS::WAFv2::WebACL.TextTransformation
 - AWS::WAFv2::WebACL.Rule
 - AWS::WAFv2::RuleGroup.RateBasedStatementTwo
 - AWS::WAFv2::RuleGroup.TextTransformation
 - AWS::WAFv2::RuleGroup.IPSetReferenceStatement
 - AWS::WAFv2::RuleGroup.Rule
 - AWS::WAFv2::WebACL.AndStatementTwo
 - AWS::WAFv2::WebACL.FieldToMatch
 - AWS::WAFv2::RuleGroup.NotStatementOne
 - AWS::WAFv2::WebACL.OrStatementTwo
 - AWS::WAFv2::WebACL.RateBasedStatementTwo
 - AWS::WAFv2::WebACL.RateBasedStatementOne
 - AWS::WAFv2::RuleGroup.VisibilityConfig
 - AWS::WAFv2::RuleGroup.OrStatementTwo
 - AWS::WAFv2::WebACL.XssMatchStatement
 - AWS::WAFv2::WebACL.RuleGroupReferenceStatement
 - AWS::Cognito::UserPool.UsernameConfiguration
 - AWS::WAFv2::WebACL.OrStatementOne
 - AWS::WAFv2::RuleGroup.AndStatementTwo
 - AWS::WAFv2::RuleGroup.NotStatementTwo
 - AWS::WAFv2::RuleGroup.GeoMatchStatement
 - AWS::WAFv2::WebACL.ByteMatchStatement
 - AWS::WAFv2::RuleGroup.FieldToMatch
 - AWS::WAFv2::RuleGroup.RateBasedStatementOne
 - AWS::WAFv2::WebACL.GeoMatchStatement
 - AWS::WAFv2::RuleGroup.RuleAction
 - AWS::WAFv2::WebACL.RegexPatternSetReferenceStatement
 - AWS::WAFv2::WebACL.NotStatementTwo
 - AWS::WAFv2::WebACL.VisibilityConfig
 - AWS::WAFv2::WebACL.NotStatementOne
 - AWS::WAFv2::RuleGroup.ByteMatchStatement
 - AWS::WAFv2::WebACL.RuleAction
 - AWS::WAFv2::RuleGroup.OrStatementOne
 - AWS::WAFv2::WebACL.SqliMatchStatement
  • Loading branch information
PaulMaddox authored Feb 22, 2020
1 parent fcae940 commit ffd88a6
Show file tree
Hide file tree
Showing 82 changed files with 5,984 additions and 2,178 deletions.
151 changes: 151 additions & 0 deletions cloudformation/all.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ import (
"github.com/awslabs/goformation/v4/cloudformation/emr"
"github.com/awslabs/goformation/v4/cloudformation/events"
"github.com/awslabs/goformation/v4/cloudformation/eventschemas"
"github.com/awslabs/goformation/v4/cloudformation/fms"
"github.com/awslabs/goformation/v4/cloudformation/fsx"
"github.com/awslabs/goformation/v4/cloudformation/gamelift"
"github.com/awslabs/goformation/v4/cloudformation/glue"
Expand Down Expand Up @@ -237,8 +238,10 @@ func AllResources() map[string]Resource {
"AWS::Config::ConfigRule": &config.ConfigRule{},
"AWS::Config::ConfigurationAggregator": &config.ConfigurationAggregator{},
"AWS::Config::ConfigurationRecorder": &config.ConfigurationRecorder{},
"AWS::Config::ConformancePack": &config.ConformancePack{},
"AWS::Config::DeliveryChannel": &config.DeliveryChannel{},
"AWS::Config::OrganizationConfigRule": &config.OrganizationConfigRule{},
"AWS::Config::OrganizationConformancePack": &config.OrganizationConformancePack{},
"AWS::Config::RemediationConfiguration": &config.RemediationConfiguration{},
"AWS::DAX::Cluster": &dax.Cluster{},
"AWS::DAX::ParameterGroup": &dax.ParameterGroup{},
Expand Down Expand Up @@ -275,6 +278,8 @@ func AllResources() map[string]Resource {
"AWS::EC2::Instance": &ec2.Instance{},
"AWS::EC2::InternetGateway": &ec2.InternetGateway{},
"AWS::EC2::LaunchTemplate": &ec2.LaunchTemplate{},
"AWS::EC2::LocalGatewayRoute": &ec2.LocalGatewayRoute{},
"AWS::EC2::LocalGatewayRouteTableVPCAssociation": &ec2.LocalGatewayRouteTableVPCAssociation{},
"AWS::EC2::NatGateway": &ec2.NatGateway{},
"AWS::EC2::NetworkAcl": &ec2.NetworkAcl{},
"AWS::EC2::NetworkAclEntry": &ec2.NetworkAclEntry{},
Expand Down Expand Up @@ -355,6 +360,8 @@ func AllResources() map[string]Resource {
"AWS::Events::EventBus": &events.EventBus{},
"AWS::Events::EventBusPolicy": &events.EventBusPolicy{},
"AWS::Events::Rule": &events.Rule{},
"AWS::FMS::NotificationChannel": &fms.NotificationChannel{},
"AWS::FMS::Policy": &fms.Policy{},
"AWS::FSx::FileSystem": &fsx.FileSystem{},
"AWS::GameLift::Alias": &gamelift.Alias{},
"AWS::GameLift::Build": &gamelift.Build{},
Expand Down Expand Up @@ -3571,6 +3578,30 @@ func (t *Template) GetConfigConfigurationRecorderWithName(name string) (*config.
return nil, fmt.Errorf("resource %q of type config.ConfigurationRecorder not found", name)
}

// GetAllConfigConformancePackResources retrieves all config.ConformancePack items from an AWS CloudFormation template
func (t *Template) GetAllConfigConformancePackResources() map[string]*config.ConformancePack {
results := map[string]*config.ConformancePack{}
for name, untyped := range t.Resources {
switch resource := untyped.(type) {
case *config.ConformancePack:
results[name] = resource
}
}
return results
}

// GetConfigConformancePackWithName retrieves all config.ConformancePack items from an AWS CloudFormation template
// whose logical ID matches the provided name. Returns an error if not found.
func (t *Template) GetConfigConformancePackWithName(name string) (*config.ConformancePack, error) {
if untyped, ok := t.Resources[name]; ok {
switch resource := untyped.(type) {
case *config.ConformancePack:
return resource, nil
}
}
return nil, fmt.Errorf("resource %q of type config.ConformancePack not found", name)
}

// GetAllConfigDeliveryChannelResources retrieves all config.DeliveryChannel items from an AWS CloudFormation template
func (t *Template) GetAllConfigDeliveryChannelResources() map[string]*config.DeliveryChannel {
results := map[string]*config.DeliveryChannel{}
Expand Down Expand Up @@ -3619,6 +3650,30 @@ func (t *Template) GetConfigOrganizationConfigRuleWithName(name string) (*config
return nil, fmt.Errorf("resource %q of type config.OrganizationConfigRule not found", name)
}

// GetAllConfigOrganizationConformancePackResources retrieves all config.OrganizationConformancePack items from an AWS CloudFormation template
func (t *Template) GetAllConfigOrganizationConformancePackResources() map[string]*config.OrganizationConformancePack {
results := map[string]*config.OrganizationConformancePack{}
for name, untyped := range t.Resources {
switch resource := untyped.(type) {
case *config.OrganizationConformancePack:
results[name] = resource
}
}
return results
}

// GetConfigOrganizationConformancePackWithName retrieves all config.OrganizationConformancePack items from an AWS CloudFormation template
// whose logical ID matches the provided name. Returns an error if not found.
func (t *Template) GetConfigOrganizationConformancePackWithName(name string) (*config.OrganizationConformancePack, error) {
if untyped, ok := t.Resources[name]; ok {
switch resource := untyped.(type) {
case *config.OrganizationConformancePack:
return resource, nil
}
}
return nil, fmt.Errorf("resource %q of type config.OrganizationConformancePack not found", name)
}

// GetAllConfigRemediationConfigurationResources retrieves all config.RemediationConfiguration items from an AWS CloudFormation template
func (t *Template) GetAllConfigRemediationConfigurationResources() map[string]*config.RemediationConfiguration {
results := map[string]*config.RemediationConfiguration{}
Expand Down Expand Up @@ -4483,6 +4538,54 @@ func (t *Template) GetEC2LaunchTemplateWithName(name string) (*ec2.LaunchTemplat
return nil, fmt.Errorf("resource %q of type ec2.LaunchTemplate not found", name)
}

// GetAllEC2LocalGatewayRouteResources retrieves all ec2.LocalGatewayRoute items from an AWS CloudFormation template
func (t *Template) GetAllEC2LocalGatewayRouteResources() map[string]*ec2.LocalGatewayRoute {
results := map[string]*ec2.LocalGatewayRoute{}
for name, untyped := range t.Resources {
switch resource := untyped.(type) {
case *ec2.LocalGatewayRoute:
results[name] = resource
}
}
return results
}

// GetEC2LocalGatewayRouteWithName retrieves all ec2.LocalGatewayRoute items from an AWS CloudFormation template
// whose logical ID matches the provided name. Returns an error if not found.
func (t *Template) GetEC2LocalGatewayRouteWithName(name string) (*ec2.LocalGatewayRoute, error) {
if untyped, ok := t.Resources[name]; ok {
switch resource := untyped.(type) {
case *ec2.LocalGatewayRoute:
return resource, nil
}
}
return nil, fmt.Errorf("resource %q of type ec2.LocalGatewayRoute not found", name)
}

// GetAllEC2LocalGatewayRouteTableVPCAssociationResources retrieves all ec2.LocalGatewayRouteTableVPCAssociation items from an AWS CloudFormation template
func (t *Template) GetAllEC2LocalGatewayRouteTableVPCAssociationResources() map[string]*ec2.LocalGatewayRouteTableVPCAssociation {
results := map[string]*ec2.LocalGatewayRouteTableVPCAssociation{}
for name, untyped := range t.Resources {
switch resource := untyped.(type) {
case *ec2.LocalGatewayRouteTableVPCAssociation:
results[name] = resource
}
}
return results
}

// GetEC2LocalGatewayRouteTableVPCAssociationWithName retrieves all ec2.LocalGatewayRouteTableVPCAssociation items from an AWS CloudFormation template
// whose logical ID matches the provided name. Returns an error if not found.
func (t *Template) GetEC2LocalGatewayRouteTableVPCAssociationWithName(name string) (*ec2.LocalGatewayRouteTableVPCAssociation, error) {
if untyped, ok := t.Resources[name]; ok {
switch resource := untyped.(type) {
case *ec2.LocalGatewayRouteTableVPCAssociation:
return resource, nil
}
}
return nil, fmt.Errorf("resource %q of type ec2.LocalGatewayRouteTableVPCAssociation not found", name)
}

// GetAllEC2NatGatewayResources retrieves all ec2.NatGateway items from an AWS CloudFormation template
func (t *Template) GetAllEC2NatGatewayResources() map[string]*ec2.NatGateway {
results := map[string]*ec2.NatGateway{}
Expand Down Expand Up @@ -6403,6 +6506,54 @@ func (t *Template) GetEventsRuleWithName(name string) (*events.Rule, error) {
return nil, fmt.Errorf("resource %q of type events.Rule not found", name)
}

// GetAllFMSNotificationChannelResources retrieves all fms.NotificationChannel items from an AWS CloudFormation template
func (t *Template) GetAllFMSNotificationChannelResources() map[string]*fms.NotificationChannel {
results := map[string]*fms.NotificationChannel{}
for name, untyped := range t.Resources {
switch resource := untyped.(type) {
case *fms.NotificationChannel:
results[name] = resource
}
}
return results
}

// GetFMSNotificationChannelWithName retrieves all fms.NotificationChannel items from an AWS CloudFormation template
// whose logical ID matches the provided name. Returns an error if not found.
func (t *Template) GetFMSNotificationChannelWithName(name string) (*fms.NotificationChannel, error) {
if untyped, ok := t.Resources[name]; ok {
switch resource := untyped.(type) {
case *fms.NotificationChannel:
return resource, nil
}
}
return nil, fmt.Errorf("resource %q of type fms.NotificationChannel not found", name)
}

// GetAllFMSPolicyResources retrieves all fms.Policy items from an AWS CloudFormation template
func (t *Template) GetAllFMSPolicyResources() map[string]*fms.Policy {
results := map[string]*fms.Policy{}
for name, untyped := range t.Resources {
switch resource := untyped.(type) {
case *fms.Policy:
results[name] = resource
}
}
return results
}

// GetFMSPolicyWithName retrieves all fms.Policy items from an AWS CloudFormation template
// whose logical ID matches the provided name. Returns an error if not found.
func (t *Template) GetFMSPolicyWithName(name string) (*fms.Policy, error) {
if untyped, ok := t.Resources[name]; ok {
switch resource := untyped.(type) {
case *fms.Policy:
return resource, nil
}
}
return nil, fmt.Errorf("resource %q of type fms.Policy not found", name)
}

// GetAllFSxFileSystemResources retrieves all fsx.FileSystem items from an AWS CloudFormation template
func (t *Template) GetAllFSxFileSystemResources() map[string]*fsx.FileSystem {
results := map[string]*fsx.FileSystem{}
Expand Down
5 changes: 5 additions & 0 deletions cloudformation/codebuild/aws-codebuild-project.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ type Project struct {
// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codebuild-project.html#cfn-codebuild-project-environment
Environment *Project_Environment `json:"Environment,omitempty"`

// FileSystemLocations AWS CloudFormation Property
// Required: false
// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codebuild-project.html#cfn-codebuild-project-filesystemlocations
FileSystemLocations []Project_ProjectFileSystemLocation `json:"FileSystemLocations,omitempty"`

// LogsConfig AWS CloudFormation Property
// Required: false
// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-codebuild-project.html#cfn-codebuild-project-logsconfig
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
package codebuild

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

// Project_ProjectFileSystemLocation AWS CloudFormation Resource (AWS::CodeBuild::Project.ProjectFileSystemLocation)
// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-projectfilesystemlocation.html
type Project_ProjectFileSystemLocation struct {

// Identifier AWS CloudFormation Property
// Required: true
// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-projectfilesystemlocation.html#cfn-codebuild-project-projectfilesystemlocation-identifier
Identifier string `json:"Identifier,omitempty"`

// Location AWS CloudFormation Property
// Required: true
// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-projectfilesystemlocation.html#cfn-codebuild-project-projectfilesystemlocation-location
Location string `json:"Location,omitempty"`

// MountOptions AWS CloudFormation Property
// Required: false
// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-projectfilesystemlocation.html#cfn-codebuild-project-projectfilesystemlocation-mountoptions
MountOptions string `json:"MountOptions,omitempty"`

// MountPoint AWS CloudFormation Property
// Required: true
// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-projectfilesystemlocation.html#cfn-codebuild-project-projectfilesystemlocation-mountpoint
MountPoint string `json:"MountPoint,omitempty"`

// Type AWS CloudFormation Property
// Required: true
// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-projectfilesystemlocation.html#cfn-codebuild-project-projectfilesystemlocation-type
Type string `json:"Type,omitempty"`

// AWSCloudFormationDeletionPolicy represents a CloudFormation DeletionPolicy
AWSCloudFormationDeletionPolicy policies.DeletionPolicy `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 *Project_ProjectFileSystemLocation) AWSCloudFormationType() string {
return "AWS::CodeBuild::Project.ProjectFileSystemLocation"
}
5 changes: 5 additions & 0 deletions cloudformation/cognito/aws-cognito-userpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,11 @@ type UserPool struct {
// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cognito-userpool.html#cfn-cognito-userpool-usernameattributes
UsernameAttributes []string `json:"UsernameAttributes,omitempty"`

// UsernameConfiguration AWS CloudFormation Property
// Required: false
// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cognito-userpool.html#cfn-cognito-userpool-usernameconfiguration
UsernameConfiguration *UserPool_UsernameConfiguration `json:"UsernameConfiguration,omitempty"`

// VerificationMessageTemplate AWS CloudFormation Property
// Required: false
// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cognito-userpool.html#cfn-cognito-userpool-verificationmessagetemplate
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package cognito

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

// UserPool_UsernameConfiguration AWS CloudFormation Resource (AWS::Cognito::UserPool.UsernameConfiguration)
// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cognito-userpool-usernameconfiguration.html
type UserPool_UsernameConfiguration struct {

// CaseSensitive AWS CloudFormation Property
// Required: false
// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cognito-userpool-usernameconfiguration.html#cfn-cognito-userpool-usernameconfiguration-casesensitive
CaseSensitive bool `json:"CaseSensitive,omitempty"`

// AWSCloudFormationDeletionPolicy represents a CloudFormation DeletionPolicy
AWSCloudFormationDeletionPolicy policies.DeletionPolicy `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 *UserPool_UsernameConfiguration) AWSCloudFormationType() string {
return "AWS::Cognito::UserPool.UsernameConfiguration"
}
6 changes: 6 additions & 0 deletions cloudformation/config/aws-config-aggregationauthorization.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"
)

// AggregationAuthorization AWS CloudFormation Resource (AWS::Config::AggregationAuthorization)
Expand All @@ -22,6 +23,11 @@ type AggregationAuthorization struct {
// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-config-aggregationauthorization.html#cfn-config-aggregationauthorization-authorizedawsregion
AuthorizedAwsRegion string `json:"AuthorizedAwsRegion,omitempty"`

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

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

Expand Down
6 changes: 6 additions & 0 deletions cloudformation/config/aws-config-configurationaggregator.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"
)

// ConfigurationAggregator AWS CloudFormation Resource (AWS::Config::ConfigurationAggregator)
Expand All @@ -27,6 +28,11 @@ type ConfigurationAggregator struct {
// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-config-configurationaggregator.html#cfn-config-configurationaggregator-organizationaggregationsource
OrganizationAggregationSource *ConfigurationAggregator_OrganizationAggregationSource `json:"OrganizationAggregationSource,omitempty"`

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

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

Expand Down
Loading

0 comments on commit ffd88a6

Please sign in to comment.