forked from awslabs/goformation
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(schema): CloudFormation Updates (2019-12-09) (awslabs#251)
Updated the following AWS CloudFormation resources: - AWS::ApiGatewayV2::Stage - AWS::ApiGatewayV2::Api - AWS::S3::AccessPoint - AWS::EventSchemas::Schema - AWS::GuardDuty::Filter - AWS::WAFv2::RuleGroup - AWS::StepFunctions::StateMachine - AWS::ApiGatewayV2::Integration - AWS::WAFv2::RegexPatternSet - AWS::EventSchemas::Registry - AWS::Lambda::Alias - AWS::EventSchemas::Discoverer - AWS::Lambda::Version - AWS::ApiGatewayV2::Authorizer - AWS::WAFv2::WebACL - AWS::AccessAnalyzer::Analyzer - AWS::WAFv2::IPSet - AWS::EventSchemas::Registry.TagsEntry - AWS::StepFunctions::StateMachine.LoggingConfiguration - AWS::WAFv2::RuleGroup.IPSetReferenceStatement - AWS::Lambda::Alias.ProvisionedConcurrencyConfiguration - AWS::FSx::FileSystem.WindowsConfiguration - AWS::WAFv2::WebACL.IPSetReferenceStatement - AWS::S3::AccessPoint.VpcConfiguration - AWS::AccessAnalyzer::Analyzer.Filter - AWS::S3::AccessPoint.PublicAccessBlockConfiguration - AWS::WAFv2::WebACL.RuleGroupReferenceStatement - AWS::WAFv2::RuleGroup.RegexPatternSetReferenceStatement - AWS::ApiGatewayV2::Api.Cors - AWS::EventSchemas::Schema.TagsEntry - AWS::ApiGatewayV2::Authorizer.JWTConfiguration - AWS::EventSchemas::Discoverer.TagsEntry - AWS::StepFunctions::StateMachine.LogDestination - AWS::Lambda::Version.ProvisionedConcurrencyConfiguration - AWS::StepFunctions::StateMachine.CloudWatchLogsLogGroup - AWS::AccessAnalyzer::Analyzer.ArchiveRule - AWS::ApiGatewayV2::Api.BodyS3Location - AWS::WAFv2::WebACL.RegexPatternSetReferenceStatement
- Loading branch information
1 parent
e52b3b3
commit a23ba41
Showing
43 changed files
with
4,209 additions
and
1,815 deletions.
There are no files selected for viewing
104 changes: 104 additions & 0 deletions
104
cloudformation/accessanalyzer/aws-accessanalyzer-analyzer.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
package accessanalyzer | ||
|
||
import ( | ||
"bytes" | ||
"encoding/json" | ||
"fmt" | ||
|
||
"github.com/awslabs/goformation/v4/cloudformation/policies" | ||
"github.com/awslabs/goformation/v4/cloudformation/tags" | ||
) | ||
|
||
// Analyzer AWS CloudFormation Resource (AWS::AccessAnalyzer::Analyzer) | ||
// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-accessanalyzer-analyzer.html | ||
type Analyzer struct { | ||
|
||
// AnalyzerName AWS CloudFormation Property | ||
// Required: false | ||
// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-accessanalyzer-analyzer.html#cfn-accessanalyzer-analyzer-analyzername | ||
AnalyzerName string `json:"AnalyzerName,omitempty"` | ||
|
||
// ArchiveRules AWS CloudFormation Property | ||
// Required: false | ||
// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-accessanalyzer-analyzer.html#cfn-accessanalyzer-analyzer-archiverules | ||
ArchiveRules []Analyzer_ArchiveRule `json:"ArchiveRules,omitempty"` | ||
|
||
// Tags AWS CloudFormation Property | ||
// Required: false | ||
// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-accessanalyzer-analyzer.html#cfn-accessanalyzer-analyzer-tags | ||
Tags []tags.Tag `json:"Tags,omitempty"` | ||
|
||
// Type AWS CloudFormation Property | ||
// Required: true | ||
// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-accessanalyzer-analyzer.html#cfn-accessanalyzer-analyzer-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:"-"` | ||
} | ||
|
||
// AWSCloudFormationType returns the AWS CloudFormation resource type | ||
func (r *Analyzer) AWSCloudFormationType() string { | ||
return "AWS::AccessAnalyzer::Analyzer" | ||
} | ||
|
||
// 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 Analyzer) MarshalJSON() ([]byte, error) { | ||
type Properties Analyzer | ||
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"` | ||
}{ | ||
Type: r.AWSCloudFormationType(), | ||
Properties: (Properties)(r), | ||
DependsOn: r.AWSCloudFormationDependsOn, | ||
Metadata: r.AWSCloudFormationMetadata, | ||
DeletionPolicy: r.AWSCloudFormationDeletionPolicy, | ||
}) | ||
} | ||
|
||
// UnmarshalJSON is a custom JSON unmarshalling hook that strips the outer | ||
// AWS CloudFormation resource object, and just keeps the 'Properties' field. | ||
func (r *Analyzer) UnmarshalJSON(b []byte) error { | ||
type Properties Analyzer | ||
res := &struct { | ||
Type string | ||
Properties *Properties | ||
DependsOn []string | ||
Metadata map[string]interface{} | ||
DeletionPolicy 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 = Analyzer(*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) | ||
} | ||
return nil | ||
} |
34 changes: 34 additions & 0 deletions
34
cloudformation/accessanalyzer/aws-accessanalyzer-analyzer_archiverule.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package accessanalyzer | ||
|
||
import ( | ||
"github.com/awslabs/goformation/v4/cloudformation/policies" | ||
) | ||
|
||
// Analyzer_ArchiveRule AWS CloudFormation Resource (AWS::AccessAnalyzer::Analyzer.ArchiveRule) | ||
// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-accessanalyzer-analyzer-archiverule.html | ||
type Analyzer_ArchiveRule struct { | ||
|
||
// Filter AWS CloudFormation Property | ||
// Required: true | ||
// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-accessanalyzer-analyzer-archiverule.html#cfn-accessanalyzer-analyzer-archiverule-filter | ||
Filter []Analyzer_Filter `json:"Filter,omitempty"` | ||
|
||
// RuleName AWS CloudFormation Property | ||
// Required: true | ||
// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-accessanalyzer-analyzer-archiverule.html#cfn-accessanalyzer-analyzer-archiverule-rulename | ||
RuleName string `json:"RuleName,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:"-"` | ||
} | ||
|
||
// AWSCloudFormationType returns the AWS CloudFormation resource type | ||
func (r *Analyzer_ArchiveRule) AWSCloudFormationType() string { | ||
return "AWS::AccessAnalyzer::Analyzer.ArchiveRule" | ||
} |
49 changes: 49 additions & 0 deletions
49
cloudformation/accessanalyzer/aws-accessanalyzer-analyzer_filter.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package accessanalyzer | ||
|
||
import ( | ||
"github.com/awslabs/goformation/v4/cloudformation/policies" | ||
) | ||
|
||
// Analyzer_Filter AWS CloudFormation Resource (AWS::AccessAnalyzer::Analyzer.Filter) | ||
// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-accessanalyzer-analyzer-filter.html | ||
type Analyzer_Filter struct { | ||
|
||
// Contains AWS CloudFormation Property | ||
// Required: false | ||
// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-accessanalyzer-analyzer-filter.html#cfn-accessanalyzer-analyzer-filter-contains | ||
Contains []string `json:"Contains,omitempty"` | ||
|
||
// Eq AWS CloudFormation Property | ||
// Required: false | ||
// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-accessanalyzer-analyzer-filter.html#cfn-accessanalyzer-analyzer-filter-eq | ||
Eq []string `json:"Eq,omitempty"` | ||
|
||
// Exists AWS CloudFormation Property | ||
// Required: false | ||
// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-accessanalyzer-analyzer-filter.html#cfn-accessanalyzer-analyzer-filter-exists | ||
Exists bool `json:"Exists,omitempty"` | ||
|
||
// Neq AWS CloudFormation Property | ||
// Required: false | ||
// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-accessanalyzer-analyzer-filter.html#cfn-accessanalyzer-analyzer-filter-neq | ||
Neq []string `json:"Neq,omitempty"` | ||
|
||
// Property AWS CloudFormation Property | ||
// Required: true | ||
// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-accessanalyzer-analyzer-filter.html#cfn-accessanalyzer-analyzer-filter-property | ||
Property string `json:"Property,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:"-"` | ||
} | ||
|
||
// AWSCloudFormationType returns the AWS CloudFormation resource type | ||
func (r *Analyzer_Filter) AWSCloudFormationType() string { | ||
return "AWS::AccessAnalyzer::Analyzer.Filter" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.