diff --git a/cloudformation/serverless/aws-serverless-function_httpapievent.go b/cloudformation/serverless/aws-serverless-function_httpapievent.go new file mode 100644 index 0000000000..5b0483ada3 --- /dev/null +++ b/cloudformation/serverless/aws-serverless-function_httpapievent.go @@ -0,0 +1,67 @@ +// Code generated by "go generate". Please don't change this file directly. + +package serverless + +import ( + "github.com/awslabs/goformation/v7/cloudformation/policies" +) + +// Function_HttpApiEvent AWS CloudFormation Resource (AWS::Serverless::Function.HttpApiEvent) +// See: https://github.com/aws/serverless-application-model/blob/master/versions/2016-10-31.md#httpapi +type Function_HttpApiEvent struct { + + // ApiId AWS CloudFormation Property + // Required: false + // See: https://github.com/aws/serverless-application-model/blob/master/versions/2016-10-31.md#httpapi + ApiId *string `json:"ApiId,omitempty"` + + // Auth AWS CloudFormation Property + // Required: false + // See: https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-property-function-httpapi.html + Auth *Function_HttpApiFunctionAuth `json:"Auth,omitempty"` + + // Method AWS CloudFormation Property + // Required: false + // See: https://github.com/aws/serverless-application-model/blob/master/versions/2016-10-31.md#httpapi + Method *string `json:"Method,omitempty"` + + // Path AWS CloudFormation Property + // Required: false + // See: https://github.com/aws/serverless-application-model/blob/master/versions/2016-10-31.md#httpapi + Path *string `json:"Path,omitempty"` + + // PayloadFormatVersion AWS CloudFormation Property + // Required: false + // See: https://github.com/aws/serverless-application-model/blob/master/versions/2016-10-31.md#httpapi + PayloadFormatVersion *string `json:"PayloadFormatVersion,omitempty"` + + // RouteSettings AWS CloudFormation Property + // Required: false + // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-stage.html#cfn-apigatewayv2-stage-routesettings + RouteSettings *Function_RouteSettings `json:"RouteSettings,omitempty"` + + // TimeoutInMillis AWS CloudFormation Property + // Required: false + // See: https://github.com/aws/serverless-application-model/blob/master/versions/2016-10-31.md#httpapi + TimeoutInMillis *int `json:"TimeoutInMillis,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 *Function_HttpApiEvent) AWSCloudFormationType() string { + return "AWS::Serverless::Function.HttpApiEvent" +} diff --git a/cloudformation/serverless/aws-serverless-function_httpapifunctionauth.go b/cloudformation/serverless/aws-serverless-function_httpapifunctionauth.go new file mode 100644 index 0000000000..64c73b3b0f --- /dev/null +++ b/cloudformation/serverless/aws-serverless-function_httpapifunctionauth.go @@ -0,0 +1,42 @@ +// Code generated by "go generate". Please don't change this file directly. + +package serverless + +import ( + "github.com/awslabs/goformation/v7/cloudformation/policies" +) + +// Function_HttpApiFunctionAuth AWS CloudFormation Resource (AWS::Serverless::Function.HttpApiFunctionAuth) +// See: https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-property-function-httpapifunctionauth.html +type Function_HttpApiFunctionAuth struct { + + // AuthorizationScopes AWS CloudFormation Property + // Required: false + // See: https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-property-function-httpapifunctionauth.html + AuthorizationScopes []string `json:"AuthorizationScopes,omitempty"` + + // Authorizer AWS CloudFormation Property + // Required: false + // See: https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-property-function-httpapifunctionauth.html + Authorizer *string `json:"Authorizer,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 *Function_HttpApiFunctionAuth) AWSCloudFormationType() string { + return "AWS::Serverless::Function.HttpApiFunctionAuth" +} diff --git a/cloudformation/serverless/aws-serverless-function_routesettings.go b/cloudformation/serverless/aws-serverless-function_routesettings.go new file mode 100644 index 0000000000..f18ea69de3 --- /dev/null +++ b/cloudformation/serverless/aws-serverless-function_routesettings.go @@ -0,0 +1,57 @@ +// Code generated by "go generate". Please don't change this file directly. + +package serverless + +import ( + "github.com/awslabs/goformation/v7/cloudformation/policies" +) + +// Function_RouteSettings AWS CloudFormation Resource (AWS::Serverless::Function.RouteSettings) +// See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigatewayv2-stage-routesettings.html +type Function_RouteSettings struct { + + // DataTraceEnabled AWS CloudFormation Property + // Required: false + // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigatewayv2-stage-routesettings.html#cfn-apigatewayv2-stage-routesettings-datatraceenabled + DataTraceEnabled *bool `json:"DataTraceEnabled,omitempty"` + + // DetailedMetricsEnabled AWS CloudFormation Property + // Required: false + // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigatewayv2-stage-routesettings.html#cfn-apigatewayv2-stage-routesettings-detailedmetricsenabled + DetailedMetricsEnabled *bool `json:"DetailedMetricsEnabled,omitempty"` + + // LoggingLevel AWS CloudFormation Property + // Required: false + // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigatewayv2-stage-routesettings.html#cfn-apigatewayv2-stage-routesettings-logginglevel + LoggingLevel *string `json:"LoggingLevel,omitempty"` + + // ThrottlingBurstLimit AWS CloudFormation Property + // Required: false + // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigatewayv2-stage-routesettings.html#cfn-apigatewayv2-stage-routesettings-throttlingburstlimit + ThrottlingBurstLimit *int `json:"ThrottlingBurstLimit,omitempty"` + + // ThrottlingRateLimit AWS CloudFormation Property + // Required: false + // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigatewayv2-stage-routesettings.html#cfn-apigatewayv2-stage-routesettings-throttlingratelimit + ThrottlingRateLimit *float64 `json:"ThrottlingRateLimit,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 *Function_RouteSettings) AWSCloudFormationType() string { + return "AWS::Serverless::Function.RouteSettings" +} diff --git a/cloudformation/serverless/function_properties.go b/cloudformation/serverless/function_properties.go index 631eff7a52..7f2017e00b 100644 --- a/cloudformation/serverless/function_properties.go +++ b/cloudformation/serverless/function_properties.go @@ -11,7 +11,7 @@ import ( "github.com/awslabs/goformation/v7/cloudformation/utils" ) -// Function_Properties is a helper struct that can hold either a S3Event, SNSEvent, SQSEvent, KinesisEvent, DynamoDBEvent, ApiEvent, ScheduleEvent, CloudWatchEventEvent, CloudWatchLogsEvent, IoTRuleEvent, AlexaSkillEvent, or EventBridgeRuleEvent value +// Function_Properties is a helper struct that can hold either a S3Event, SNSEvent, SQSEvent, KinesisEvent, DynamoDBEvent, ApiEvent, ScheduleEvent, CloudWatchEventEvent, CloudWatchLogsEvent, IoTRuleEvent, AlexaSkillEvent, EventBridgeRuleEvent, or HttpApiEvent value type Function_Properties struct { S3Event *Function_S3Event SNSEvent *Function_SNSEvent @@ -25,6 +25,7 @@ type Function_Properties struct { IoTRuleEvent *Function_IoTRuleEvent AlexaSkillEvent *Function_AlexaSkillEvent EventBridgeRuleEvent *Function_EventBridgeRuleEvent + HttpApiEvent *Function_HttpApiEvent } func (r Function_Properties) value() interface{} { @@ -78,6 +79,10 @@ func (r Function_Properties) value() interface{} { ret = append(ret, *r.EventBridgeRuleEvent) } + if r.HttpApiEvent != nil { + ret = append(ret, *r.HttpApiEvent) + } + sort.Sort(utils.ByJSONLength(ret)) // Heuristic to select best attribute if len(ret) > 0 { return ret[0] @@ -169,6 +174,11 @@ func (r *Function_Properties) UnmarshalJSON(b []byte) error { } reader.Seek(0, io.SeekStart) + if err := decoder.Decode(&r.HttpApiEvent); err != nil { + r.HttpApiEvent = nil + } + reader.Seek(0, io.SeekStart) + case []interface{}: } diff --git a/generate/sam-2016-10-31.json b/generate/sam-2016-10-31.json index 2194c1fced..a0c693b5ae 100644 --- a/generate/sam-2016-10-31.json +++ b/generate/sam-2016-10-31.json @@ -856,7 +856,8 @@ "CloudWatchLogsEvent", "IoTRuleEvent", "AlexaSkillEvent", - "EventBridgeRuleEvent" + "EventBridgeRuleEvent", + "HttpApiEvent" ], "UpdateType": "Immutable" } @@ -1083,6 +1084,106 @@ } } }, + "AWS::Serverless::Function.HttpApiFunctionAuth": { + "Documentation": "https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-property-function-httpapifunctionauth.html", + "Properties": { + "AuthorizationScopes": { + "Documentation": "https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-property-function-httpapifunctionauth.html", + "Required": false, + "Type": "List", + "PrimitiveItemType": "String", + "UpdateType": "Immutable" + }, + "Authorizer": { + "Documentation": "https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-property-function-httpapifunctionauth.html", + "Required": false, + "PrimitiveType": "String", + "UpdateType": "Immutable" + } + } + }, + "AWS::Serverless::Function.HttpApiEvent": { + "Documentation": "https://github.com/aws/serverless-application-model/blob/master/versions/2016-10-31.md#httpapi", + "Properties": { + "Path": { + "Documentation": "https://github.com/aws/serverless-application-model/blob/master/versions/2016-10-31.md#httpapi", + "Required": false, + "PrimitiveType": "String", + "UpdateType": "Immutable" + }, + "Method": { + "Documentation": "https://github.com/aws/serverless-application-model/blob/master/versions/2016-10-31.md#httpapi", + "Required": false, + "PrimitiveType": "String", + "UpdateType": "Immutable" + }, + "ApiId": { + "Documentation": "https://github.com/aws/serverless-application-model/blob/master/versions/2016-10-31.md#httpapi", + "Required": false, + "PrimitiveType": "String", + "UpdateType": "Immutable" + }, + "Auth": { + "Documentation": "https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-property-function-httpapi.html", + "Required": false, + "Type": "HttpApiFunctionAuth", + "UpdateType": "Immutable" + }, + "TimeoutInMillis": { + "Documentation": "https://github.com/aws/serverless-application-model/blob/master/versions/2016-10-31.md#httpapi", + "Required": false, + "PrimitiveType": "Integer", + "UpdateType": "Immutable" + }, + "PayloadFormatVersion": { + "Documentation": "https://github.com/aws/serverless-application-model/blob/master/versions/2016-10-31.md#httpapi", + "Required": false, + "PrimitiveType": "String", + "UpdateType": "Immutable" + }, + "RouteSettings": { + "Documentation": "https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigatewayv2-stage.html#cfn-apigatewayv2-stage-routesettings", + "Required": false, + "Type": "RouteSettings", + "UpdateType": "Immutable" + } + } + }, + "AWS::Serverless::Function.RouteSettings": { + "Documentation": "https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigatewayv2-stage-routesettings.html", + "Properties": { + "DataTraceEnabled": { + "Documentation": "https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigatewayv2-stage-routesettings.html#cfn-apigatewayv2-stage-routesettings-datatraceenabled", + "Required": false, + "PrimitiveType": "Boolean", + "UpdateType": "Immutable" + }, + "DetailedMetricsEnabled": { + "Documentation": "https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigatewayv2-stage-routesettings.html#cfn-apigatewayv2-stage-routesettings-detailedmetricsenabled", + "Required": false, + "PrimitiveType": "Boolean", + "UpdateType": "Immutable" + }, + "LoggingLevel": { + "Documentation": "https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigatewayv2-stage-routesettings.html#cfn-apigatewayv2-stage-routesettings-logginglevel", + "Required": false, + "PrimitiveType": "String", + "UpdateType": "Immutable" + }, + "ThrottlingBurstLimit": { + "Documentation": "https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigatewayv2-stage-routesettings.html#cfn-apigatewayv2-stage-routesettings-throttlingburstlimit", + "Required": false, + "PrimitiveType": "Integer", + "UpdateType": "Immutable" + }, + "ThrottlingRateLimit": { + "Documentation": "https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigatewayv2-stage-routesettings.html#cfn-apigatewayv2-stage-routesettings-throttlingratelimit", + "Required": false, + "PrimitiveType": "Double", + "UpdateType": "Immutable" + } + } + }, "AWS::Serverless::Function.RequestModel": { "Documentation": "https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-property-function-requestmodel.html", "Properties": { diff --git a/schema/sam.go b/schema/sam.go index 9a65b761b4..0a1cdafc4f 100644 --- a/schema/sam.go +++ b/schema/sam.go @@ -144730,6 +144730,9 @@ var SamSchema = `{ }, { "$ref": "#/definitions/AWS::Serverless::Function.EventBridgeRuleEvent" + }, + { + "$ref": "#/definitions/AWS::Serverless::Function.HttpApiEvent" } ] }, @@ -144785,6 +144788,48 @@ var SamSchema = `{ ], "type": "object" }, + "AWS::Serverless::Function.HttpApiEvent": { + "additionalProperties": false, + "properties": { + "ApiId": { + "type": "string" + }, + "Auth": { + "$ref": "#/definitions/AWS::Serverless::Function.HttpApiFunctionAuth" + }, + "Method": { + "type": "string" + }, + "Path": { + "type": "string" + }, + "PayloadFormatVersion": { + "type": "string" + }, + "RouteSettings": { + "$ref": "#/definitions/AWS::Serverless::Function.RouteSettings" + }, + "TimeoutInMillis": { + "type": "number" + } + }, + "type": "object" + }, + "AWS::Serverless::Function.HttpApiFunctionAuth": { + "additionalProperties": false, + "properties": { + "AuthorizationScopes": { + "items": { + "type": "string" + }, + "type": "array" + }, + "Authorizer": { + "type": "string" + } + }, + "type": "object" + }, "AWS::Serverless::Function.IAMPolicyDocument": { "additionalProperties": false, "properties": { @@ -144972,6 +145017,27 @@ var SamSchema = `{ }, "type": "object" }, + "AWS::Serverless::Function.RouteSettings": { + "additionalProperties": false, + "properties": { + "DataTraceEnabled": { + "type": "boolean" + }, + "DetailedMetricsEnabled": { + "type": "boolean" + }, + "LoggingLevel": { + "type": "string" + }, + "ThrottlingBurstLimit": { + "type": "number" + }, + "ThrottlingRateLimit": { + "type": "number" + } + }, + "type": "object" + }, "AWS::Serverless::Function.S3Event": { "additionalProperties": false, "properties": { diff --git a/schema/sam.schema.json b/schema/sam.schema.json index 0f7d326a75..00e1ea56ad 100644 --- a/schema/sam.schema.json +++ b/schema/sam.schema.json @@ -144725,6 +144725,9 @@ }, { "$ref": "#/definitions/AWS::Serverless::Function.EventBridgeRuleEvent" + }, + { + "$ref": "#/definitions/AWS::Serverless::Function.HttpApiEvent" } ] }, @@ -144780,6 +144783,48 @@ ], "type": "object" }, + "AWS::Serverless::Function.HttpApiEvent": { + "additionalProperties": false, + "properties": { + "ApiId": { + "type": "string" + }, + "Auth": { + "$ref": "#/definitions/AWS::Serverless::Function.HttpApiFunctionAuth" + }, + "Method": { + "type": "string" + }, + "Path": { + "type": "string" + }, + "PayloadFormatVersion": { + "type": "string" + }, + "RouteSettings": { + "$ref": "#/definitions/AWS::Serverless::Function.RouteSettings" + }, + "TimeoutInMillis": { + "type": "number" + } + }, + "type": "object" + }, + "AWS::Serverless::Function.HttpApiFunctionAuth": { + "additionalProperties": false, + "properties": { + "AuthorizationScopes": { + "items": { + "type": "string" + }, + "type": "array" + }, + "Authorizer": { + "type": "string" + } + }, + "type": "object" + }, "AWS::Serverless::Function.IAMPolicyDocument": { "additionalProperties": false, "properties": { @@ -144967,6 +145012,27 @@ }, "type": "object" }, + "AWS::Serverless::Function.RouteSettings": { + "additionalProperties": false, + "properties": { + "DataTraceEnabled": { + "type": "boolean" + }, + "DetailedMetricsEnabled": { + "type": "boolean" + }, + "LoggingLevel": { + "type": "string" + }, + "ThrottlingBurstLimit": { + "type": "number" + }, + "ThrottlingRateLimit": { + "type": "number" + } + }, + "type": "object" + }, "AWS::Serverless::Function.S3Event": { "additionalProperties": false, "properties": {