Skip to content

Commit

Permalink
fix(schema): re-generate schema
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenfonseca committed Feb 25, 2022
1 parent b8ebac0 commit 58dc56b
Show file tree
Hide file tree
Showing 26 changed files with 180 additions and 42 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package ec2

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

// Instance_PrivateDnsNameOptions AWS CloudFormation Resource (AWS::EC2::Instance.PrivateDnsNameOptions)
Expand Down
2 changes: 1 addition & 1 deletion cloudformation/ecr/aws-ecr-pullthroughcacherule.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"encoding/json"
"fmt"

"github.com/awslabs/goformation/v5/cloudformation/policies"
"github.com/awslabs/goformation/v6/cloudformation/policies"
)

// PullThroughCacheRule AWS CloudFormation Resource (AWS::ECR::PullThroughCacheRule)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package kendra

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

// DataSource_CustomDocumentEnrichmentConfiguration AWS CloudFormation Resource (AWS::Kendra::DataSource.CustomDocumentEnrichmentConfiguration)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package kendra

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

// DataSource_DocumentAttributeCondition AWS CloudFormation Resource (AWS::Kendra::DataSource.DocumentAttributeCondition)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package kendra

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

// DataSource_DocumentAttributeTarget AWS CloudFormation Resource (AWS::Kendra::DataSource.DocumentAttributeTarget)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package kendra

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

// DataSource_DocumentAttributeValue AWS CloudFormation Resource (AWS::Kendra::DataSource.DocumentAttributeValue)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package kendra

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

// DataSource_HookConfiguration AWS CloudFormation Resource (AWS::Kendra::DataSource.HookConfiguration)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package kendra

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

// DataSource_InlineCustomDocumentEnrichmentConfiguration AWS CloudFormation Resource (AWS::Kendra::DataSource.InlineCustomDocumentEnrichmentConfiguration)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package lambda

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

// EventSourceMapping_Filter AWS CloudFormation Resource (AWS::Lambda::EventSourceMapping.Filter)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package lambda

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

// EventSourceMapping_FilterCriteria AWS CloudFormation Resource (AWS::Lambda::EventSourceMapping.FilterCriteria)
Expand Down
12 changes: 11 additions & 1 deletion cloudformation/serverless/api_cors.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package serverless

import (
"bytes"
"encoding/json"
"io"
"sort"

"github.com/awslabs/goformation/v6/cloudformation/utils"
Expand Down Expand Up @@ -54,7 +56,15 @@ func (r *Api_Cors) UnmarshalJSON(b []byte) error {
case map[string]interface{}:
val = val // This ensures val is used to stop an error

json.Unmarshal(b, &r.CorsConfiguration)
reader := bytes.NewReader(b)
decoder := json.NewDecoder(reader)
decoder.DisallowUnknownFields()
reader.Seek(0, io.SeekStart)

if err := decoder.Decode(&r.CorsConfiguration); err != nil {
r.CorsConfiguration = nil
}
reader.Seek(0, io.SeekStart)

case []interface{}:

Expand Down
12 changes: 11 additions & 1 deletion cloudformation/serverless/api_definitionuri.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package serverless

import (
"bytes"
"encoding/json"
"io"
"sort"

"github.com/awslabs/goformation/v6/cloudformation/utils"
Expand Down Expand Up @@ -54,7 +56,15 @@ func (r *Api_DefinitionUri) UnmarshalJSON(b []byte) error {
case map[string]interface{}:
val = val // This ensures val is used to stop an error

json.Unmarshal(b, &r.S3Location)
reader := bytes.NewReader(b)
decoder := json.NewDecoder(reader)
decoder.DisallowUnknownFields()
reader.Seek(0, io.SeekStart)

if err := decoder.Decode(&r.S3Location); err != nil {
r.S3Location = nil
}
reader.Seek(0, io.SeekStart)

case []interface{}:

Expand Down
12 changes: 11 additions & 1 deletion cloudformation/serverless/application_location.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package serverless

import (
"bytes"
"encoding/json"
"io"
"sort"

"github.com/awslabs/goformation/v6/cloudformation/utils"
Expand Down Expand Up @@ -54,7 +56,15 @@ func (r *Application_Location) UnmarshalJSON(b []byte) error {
case map[string]interface{}:
val = val // This ensures val is used to stop an error

json.Unmarshal(b, &r.ApplicationLocation)
reader := bytes.NewReader(b)
decoder := json.NewDecoder(reader)
decoder.DisallowUnknownFields()
reader.Seek(0, io.SeekStart)

if err := decoder.Decode(&r.ApplicationLocation); err != nil {
r.ApplicationLocation = nil
}
reader.Seek(0, io.SeekStart)

case []interface{}:

Expand Down
12 changes: 11 additions & 1 deletion cloudformation/serverless/function_codeuri.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package serverless

import (
"bytes"
"encoding/json"
"io"
"sort"

"github.com/awslabs/goformation/v6/cloudformation/utils"
Expand Down Expand Up @@ -54,7 +56,15 @@ func (r *Function_CodeUri) UnmarshalJSON(b []byte) error {
case map[string]interface{}:
val = val // This ensures val is used to stop an error

json.Unmarshal(b, &r.S3Location)
reader := bytes.NewReader(b)
decoder := json.NewDecoder(reader)
decoder.DisallowUnknownFields()
reader.Seek(0, io.SeekStart)

if err := decoder.Decode(&r.S3Location); err != nil {
r.S3Location = nil
}
reader.Seek(0, io.SeekStart)

case []interface{}:

Expand Down
7 changes: 7 additions & 0 deletions cloudformation/serverless/function_events.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package serverless

import (
"bytes"
"encoding/json"
"io"
"sort"

"github.com/awslabs/goformation/v6/cloudformation/utils"
Expand Down Expand Up @@ -57,6 +59,11 @@ func (r *Function_Events) UnmarshalJSON(b []byte) error {
case map[string]interface{}:
val = val // This ensures val is used to stop an error

reader := bytes.NewReader(b)
decoder := json.NewDecoder(reader)
decoder.DisallowUnknownFields()
reader.Seek(0, io.SeekStart)

case []interface{}:

json.Unmarshal(b, &r.StringArray)
Expand Down
12 changes: 11 additions & 1 deletion cloudformation/serverless/function_policies.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package serverless

import (
"bytes"
"encoding/json"
"io"
"sort"

"github.com/awslabs/goformation/v6/cloudformation/utils"
Expand Down Expand Up @@ -74,7 +76,15 @@ func (r *Function_Policies) UnmarshalJSON(b []byte) error {
case map[string]interface{}:
val = val // This ensures val is used to stop an error

json.Unmarshal(b, &r.IAMPolicyDocument)
reader := bytes.NewReader(b)
decoder := json.NewDecoder(reader)
decoder.DisallowUnknownFields()
reader.Seek(0, io.SeekStart)

if err := decoder.Decode(&r.IAMPolicyDocument); err != nil {
r.IAMPolicyDocument = nil
}
reader.Seek(0, io.SeekStart)

case []interface{}:

Expand Down
25 changes: 13 additions & 12 deletions cloudformation/serverless/function_properties.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ func (r Function_Properties) value() interface{} {
sort.Sort(utils.ByJSONLength(ret)) // Heuristic to select best attribute
if len(ret) > 0 {
return ret[0]
// log.Fatalf("FunctionProperties matched more than one property. This is a bug. %+v", r)
}

return nil
Expand All @@ -106,65 +105,67 @@ func (r *Function_Properties) UnmarshalJSON(b []byte) error {
reader := bytes.NewReader(b)
decoder := json.NewDecoder(reader)
decoder.DisallowUnknownFields()
reader.Seek(0, io.SeekStart)

if err := decoder.Decode(&r.S3Event); err != nil {
r.S3Event = nil
}

reader.Seek(0, io.SeekStart)

if err := decoder.Decode(&r.SNSEvent); err != nil {
r.SNSEvent = nil
}

reader.Seek(0, io.SeekStart)

if err := decoder.Decode(&r.SQSEvent); err != nil {
r.SQSEvent = nil
}

reader.Seek(0, io.SeekStart)

if err := decoder.Decode(&r.KinesisEvent); err != nil {
r.KinesisEvent = nil
}

reader.Seek(0, io.SeekStart)

if err := decoder.Decode(&r.DynamoDBEvent); err != nil {
r.DynamoDBEvent = nil
}

reader.Seek(0, io.SeekStart)

if err := decoder.Decode(&r.ApiEvent); err != nil {
r.ApiEvent = nil
}

reader.Seek(0, io.SeekStart)

if err := decoder.Decode(&r.ScheduleEvent); err != nil {
r.ScheduleEvent = nil
}

reader.Seek(0, io.SeekStart)

if err := decoder.Decode(&r.CloudWatchEventEvent); err != nil {
r.CloudWatchEventEvent = nil
}

reader.Seek(0, io.SeekStart)

if err := decoder.Decode(&r.CloudWatchLogsEvent); err != nil {
r.CloudWatchLogsEvent = nil
}

reader.Seek(0, io.SeekStart)

if err := decoder.Decode(&r.IoTRuleEvent); err != nil {
r.IoTRuleEvent = nil
}

reader.Seek(0, io.SeekStart)

if err := decoder.Decode(&r.AlexaSkillEvent); err != nil {
r.AlexaSkillEvent = nil
}

reader.Seek(0, io.SeekStart)

if err := decoder.Decode(&r.EventBridgeRuleEvent); err != nil {
r.EventBridgeRuleEvent = nil
}
reader.Seek(0, io.SeekStart)

case []interface{}:

Expand Down
12 changes: 11 additions & 1 deletion cloudformation/serverless/httpapi_corsconfiguration.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package serverless

import (
"bytes"
"encoding/json"
"io"
"sort"

"github.com/awslabs/goformation/v6/cloudformation/utils"
Expand Down Expand Up @@ -54,7 +56,15 @@ func (r *HttpApi_CorsConfiguration) UnmarshalJSON(b []byte) error {
case map[string]interface{}:
val = val // This ensures val is used to stop an error

json.Unmarshal(b, &r.CorsConfigurationObject)
reader := bytes.NewReader(b)
decoder := json.NewDecoder(reader)
decoder.DisallowUnknownFields()
reader.Seek(0, io.SeekStart)

if err := decoder.Decode(&r.CorsConfigurationObject); err != nil {
r.CorsConfigurationObject = nil
}
reader.Seek(0, io.SeekStart)

case []interface{}:

Expand Down
12 changes: 11 additions & 1 deletion cloudformation/serverless/httpapi_definitionuri.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package serverless

import (
"bytes"
"encoding/json"
"io"
"sort"

"github.com/awslabs/goformation/v6/cloudformation/utils"
Expand Down Expand Up @@ -54,7 +56,15 @@ func (r *HttpApi_DefinitionUri) UnmarshalJSON(b []byte) error {
case map[string]interface{}:
val = val // This ensures val is used to stop an error

json.Unmarshal(b, &r.S3Location)
reader := bytes.NewReader(b)
decoder := json.NewDecoder(reader)
decoder.DisallowUnknownFields()
reader.Seek(0, io.SeekStart)

if err := decoder.Decode(&r.S3Location); err != nil {
r.S3Location = nil
}
reader.Seek(0, io.SeekStart)

case []interface{}:

Expand Down
Loading

0 comments on commit 58dc56b

Please sign in to comment.