diff --git a/.cfnlintrc.yaml b/.cfnlintrc.yaml index ea8e0e16a..251a6b6ea 100644 --- a/.cfnlintrc.yaml +++ b/.cfnlintrc.yaml @@ -144,7 +144,7 @@ ignore_templates: - tests/translator/output/**/function_with_metrics_config.json - tests/translator/output/**/function_with_self_managed_kafka_and_schema_registry.json # cfnlint is not updated to recognize the SchemaRegistryConfig property - tests/translator/output/**/function_with_msk_with_schema_registry_config.json # cfnlint is not updated to recognize the SchemaRegistryConfig property - - tests/translator/output/**/*capacity_provider*.json # TODO: Remove this once CFN updates + - tests/translator/output/aws-*/*capacity_provider*.json # Ignore Capacity Provider test format in non-aws partitions - tests/translator/output/**/function_with_tenancy_config.json # cfnlint is not updated to recognize the TenancyConfig property - tests/translator/output/**/function_with_tenancy_and_api_event.json # cfnlint is not updated to recognize the TenancyConfig property - tests/translator/output/**/function_with_tenancy_and_httpapi_event.json # cfnlint is not updated to recognize the TenancyConfig property diff --git a/samtranslator/internal/schema_source/aws_serverless_capacity_provider.py b/samtranslator/internal/schema_source/aws_serverless_capacity_provider.py index 8d97a501b..6c52553da 100644 --- a/samtranslator/internal/schema_source/aws_serverless_capacity_provider.py +++ b/samtranslator/internal/schema_source/aws_serverless_capacity_provider.py @@ -88,12 +88,12 @@ class Properties(BaseModel): # TODO: Change back to passthrough_prop after CloudFormation schema is updated with AWS::Lambda::CapacityProvider # Optional KMS key ARN - passes through directly to CFN for encryption configuration # Uses PassThroughProp because it's a direct 1:1 mapping with no SAM transformation - # KMSKeyArn: Optional[PassThroughProp] = passthrough_prop( + # KmsKeyArn: Optional[PassThroughProp] = passthrough_prop( # PROPERTIES_STEM, - # "KMSKeyArn", - # ["AWS::Lambda::CapacityProvider", "Properties", "KMSKeyArn"], + # "KmsKeyArn", + # ["AWS::Lambda::CapacityProvider", "Properties", "KmsKeyArn"], # ) - KMSKeyArn: Optional[PassThroughProp] # TODO: add documentation + KmsKeyArn: Optional[PassThroughProp] # TODO: add documentation class Globals(BaseModel): @@ -120,7 +120,7 @@ class Globals(BaseModel): # Uses custom ScalingConfig class because SAM renames construct (CapacityProviderScalingConfig→ScalingConfig) ScalingConfig: Optional[ScalingConfig] = properties("ScalingConfig") - KMSKeyArn: Optional[PassThroughProp] # TODO: add documentation + KmsKeyArn: Optional[PassThroughProp] # TODO: add documentation class Resource(ResourceAttributes): diff --git a/samtranslator/model/capacity_provider/generators.py b/samtranslator/model/capacity_provider/generators.py index 4983d7e91..b79e2bf5f 100644 --- a/samtranslator/model/capacity_provider/generators.py +++ b/samtranslator/model/capacity_provider/generators.py @@ -107,9 +107,9 @@ def _create_capacity_provider(self) -> LambdaCapacityProvider: if self.scaling_config: capacity_provider.CapacityProviderScalingConfig = self._transform_scaling_config() - # Set the KMSKeyArn if provided + # Set the KmsKeyArn if provided if self.kms_key_arn: - capacity_provider.KMSKeyArn = self.kms_key_arn + capacity_provider.KmsKeyArn = self.kms_key_arn # Pass through resource attributes if self.passthrough_resource_attributes: diff --git a/samtranslator/model/capacity_provider/resources.py b/samtranslator/model/capacity_provider/resources.py index 149963deb..762c59348 100644 --- a/samtranslator/model/capacity_provider/resources.py +++ b/samtranslator/model/capacity_provider/resources.py @@ -22,7 +22,7 @@ class LambdaCapacityProvider(Resource): "Tags": GeneratedProperty(), "InstanceRequirements": GeneratedProperty(), "CapacityProviderScalingConfig": GeneratedProperty(), - "KMSKeyArn": GeneratedProperty(), + "KmsKeyArn": GeneratedProperty(), } CapacityProviderName: Optional[Intrinsicable[str]] @@ -31,7 +31,7 @@ class LambdaCapacityProvider(Resource): Tags: Optional[List[Dict[str, Any]]] InstanceRequirements: Optional[Dict[str, Any]] CapacityProviderScalingConfig: Optional[Dict[str, Any]] - KMSKeyArn: Optional[Intrinsicable[str]] + KmsKeyArn: Optional[Intrinsicable[str]] runtime_attrs = { "name": lambda self: ref(self.logical_id), diff --git a/samtranslator/model/sam_resources.py b/samtranslator/model/sam_resources.py index e886508e9..68391316d 100644 --- a/samtranslator/model/sam_resources.py +++ b/samtranslator/model/sam_resources.py @@ -1468,7 +1468,7 @@ class SamCapacityProvider(SamResourceMacro): "PropagateTags": Property(False, IS_BOOL), "InstanceRequirements": Property(False, IS_DICT), "ScalingConfig": Property(False, IS_DICT), - "KMSKeyArn": Property(False, one_of(IS_STR, IS_DICT)), + "KmsKeyArn": Property(False, one_of(IS_STR, IS_DICT)), } CapacityProviderName: Optional[Intrinsicable[str]] @@ -1478,7 +1478,7 @@ class SamCapacityProvider(SamResourceMacro): PropagateTags: Optional[bool] InstanceRequirements: Optional[Dict[str, Any]] ScalingConfig: Optional[Dict[str, Any]] - KMSKeyArn: Optional[Intrinsicable[str]] + KmsKeyArn: Optional[Intrinsicable[str]] # Validation rules __validation_rules__ = [ @@ -1509,7 +1509,7 @@ def to_cloudformation(self, **kwargs: Any) -> List[Resource]: model.InstanceRequirements.dict(exclude_none=True) if model.InstanceRequirements else None ), scaling_config=model.ScalingConfig.dict(exclude_none=True) if model.ScalingConfig else None, - kms_key_arn=passthrough_value(model.KMSKeyArn), + kms_key_arn=passthrough_value(model.KmsKeyArn), depends_on=self.depends_on, resource_attributes=self.resource_attributes, passthrough_resource_attributes=self.get_passthrough_resource_attributes(), diff --git a/samtranslator/plugins/globals/globals.py b/samtranslator/plugins/globals/globals.py index 94de72d3c..dc004d475 100644 --- a/samtranslator/plugins/globals/globals.py +++ b/samtranslator/plugins/globals/globals.py @@ -110,7 +110,7 @@ class Globals: "Tags", "InstanceRequirements", "ScalingConfig", - "KMSKeyArn", + "KmsKeyArn", "PropagateTags", ], } diff --git a/samtranslator/schema/schema.json b/samtranslator/schema/schema.json index ae44d3590..691b581d0 100644 --- a/samtranslator/schema/schema.json +++ b/samtranslator/schema/schema.json @@ -278147,7 +278147,7 @@ "markdownDescription": "Instance requirements for the capacity provider.\n*Type*: [InstanceRequirements](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-property-capacityprovider-instancerequirements.html)\n*Required*: No\n*AWS CloudFormation compatibility*: This property is passed directly to the [`InstanceRequirements`](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-capacityprovider.html#cfn-lambda-capacityprovider-instancerequirements) property of an `AWS::Lambda::CapacityProvider` resource.", "title": "InstanceRequirements" }, - "KMSKeyArn": { + "KmsKeyArn": { "$ref": "#/definitions/PassThroughProp" }, "OperatorRole": { @@ -278206,7 +278206,7 @@ "markdownDescription": "Instance requirements for the capacity provider.\n*Type*: [InstanceRequirements](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-property-capacityprovider-instancerequirements.html)\n*Required*: No\n*AWS CloudFormation compatibility*: This property is passed directly to the [`InstanceRequirements`](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-capacityprovider.html#cfn-lambda-capacityprovider-instancerequirements) property of an `AWS::Lambda::CapacityProvider` resource.", "title": "InstanceRequirements" }, - "KMSKeyArn": { + "KmsKeyArn": { "$ref": "#/definitions/PassThroughProp" }, "OperatorRole": { diff --git a/schema_source/sam.schema.json b/schema_source/sam.schema.json index 71e3d80b0..5e75cf527 100644 --- a/schema_source/sam.schema.json +++ b/schema_source/sam.schema.json @@ -5138,7 +5138,7 @@ "markdownDescription": "Instance requirements for the capacity provider.\n*Type*: [InstanceRequirements](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-property-capacityprovider-instancerequirements.html)\n*Required*: No\n*AWS CloudFormation compatibility*: This property is passed directly to the [`InstanceRequirements`](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-capacityprovider.html#cfn-lambda-capacityprovider-instancerequirements) property of an `AWS::Lambda::CapacityProvider` resource.", "title": "InstanceRequirements" }, - "KMSKeyArn": { + "KmsKeyArn": { "$ref": "#/definitions/PassThroughProp" }, "OperatorRole": { @@ -5197,7 +5197,7 @@ "markdownDescription": "Instance requirements for the capacity provider.\n*Type*: [InstanceRequirements](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-property-capacityprovider-instancerequirements.html)\n*Required*: No\n*AWS CloudFormation compatibility*: This property is passed directly to the [`InstanceRequirements`](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-capacityprovider.html#cfn-lambda-capacityprovider-instancerequirements) property of an `AWS::Lambda::CapacityProvider` resource.", "title": "InstanceRequirements" }, - "KMSKeyArn": { + "KmsKeyArn": { "$ref": "#/definitions/PassThroughProp" }, "OperatorRole": { diff --git a/tests/model/capacity_provider/test_generators.py b/tests/model/capacity_provider/test_generators.py index 11f6d784b..e7c2f6f49 100644 --- a/tests/model/capacity_provider/test_generators.py +++ b/tests/model/capacity_provider/test_generators.py @@ -96,7 +96,7 @@ def test_to_cloudformation_with_provided_permissions(self): properties["VpcConfig"], {"SubnetIds": ["subnet-123", "subnet-456"], "SecurityGroupIds": ["sg-123"]} ) self.assertEqual(properties["PermissionsConfig"]["CapacityProviderOperatorRoleArn"], operator_role) - self.assertEqual(properties["KMSKeyArn"], self.kms_key_arn) + self.assertEqual(properties["KmsKeyArn"], self.kms_key_arn) def test_to_cloudformation_with_auto_generated_permissions(self): """Test to_cloudformation with auto-generated operator role""" diff --git a/tests/model/capacity_provider/test_resources.py b/tests/model/capacity_provider/test_resources.py index 66afa9d43..6be794af3 100644 --- a/tests/model/capacity_provider/test_resources.py +++ b/tests/model/capacity_provider/test_resources.py @@ -32,7 +32,7 @@ def test_properties(self): {"PredefinedMetricType": "LambdaCapacityProviderAverageCPUUtilization", "TargetValue": 70.0} ], } - capacity_provider.KMSKeyArn = "arn:aws:kms:us-west-2:123456789012:key/abcd1234-ab12-cd34-ef56-abcdef123456" + capacity_provider.KmsKeyArn = "arn:aws:kms:us-west-2:123456789012:key/abcd1234-ab12-cd34-ef56-abcdef123456" # Verify properties self.assertEqual(capacity_provider.CapacityProviderName, "test-provider") @@ -64,7 +64,7 @@ def test_properties(self): }, ) self.assertEqual( - capacity_provider.KMSKeyArn, "arn:aws:kms:us-west-2:123456789012:key/abcd1234-ab12-cd34-ef56-abcdef123456" + capacity_provider.KmsKeyArn, "arn:aws:kms:us-west-2:123456789012:key/abcd1234-ab12-cd34-ef56-abcdef123456" ) def test_runtime_attributes(self): diff --git a/tests/translator/input/capacity_provider_full.yaml b/tests/translator/input/capacity_provider_full.yaml index c446560c9..b927da2c2 100644 --- a/tests/translator/input/capacity_provider_full.yaml +++ b/tests/translator/input/capacity_provider_full.yaml @@ -25,12 +25,12 @@ Resources: ScalingConfig: MaxVCpuCount: 10 AverageCPUUtilization: 75.0 - KMSKeyArn: arn:aws:kms:us-east-1:123456789012:key/abcd1234-ef56-gh78-ij90-klmnopqrstuv + KmsKeyArn: arn:aws:kms:us-east-1:123456789012:key/abcd1234-ef56-gh78-ij90-klmnopqrstuv CapacityProviderTwo: Type: AWS::Serverless::CapacityProvider Properties: - CapacityProviderName: customized-capacity-provider + CapacityProviderName: customized-capacity-provider2 VpcConfig: SecurityGroupIds: - sg-12345678 @@ -39,7 +39,7 @@ Resources: - subnet-12345678 ScalingConfig: AverageCPUUtilization: 75.0 - KMSKeyArn: arn:aws:kms:us-east-1:123456789012:key/abcd1234-ef56-gh78-ij90-klmnopqrstuv + KmsKeyArn: arn:aws:kms:us-east-1:123456789012:key/abcd1234-ef56-gh78-ij90-klmnopqrstuv PartialCapacityProviderThree: Type: AWS::Serverless::CapacityProvider @@ -57,4 +57,4 @@ Resources: - c5.xlarge ScalingConfig: MaxVCpuCount: 10 - KMSKeyArn: arn:aws:kms:us-east-1:123456789012:key/abcd1234-ef56-gh78-ij90-klmnopqrstuv + KmsKeyArn: arn:aws:kms:us-east-1:123456789012:key/abcd1234-ef56-gh78-ij90-klmnopqrstuv diff --git a/tests/translator/input/capacity_provider_global_with_functions.yaml b/tests/translator/input/capacity_provider_global_with_functions.yaml index 1e675cfe7..21b6d7ff9 100644 --- a/tests/translator/input/capacity_provider_global_with_functions.yaml +++ b/tests/translator/input/capacity_provider_global_with_functions.yaml @@ -48,7 +48,7 @@ Globals: InstanceRequirements: Architectures: - x86_64 - KMSKeyArn: some-kms-arn + KmsKeyArn: some-kms-arn Function: Runtime: python3.12 @@ -131,8 +131,6 @@ Resources: Properties: CapacityProviderName: !Sub "${AWS::StackName}-${Environment}-capacity-provider" InstanceRequirements: - Architectures: - - arm64 ExcludedTypes: - t2.micro - t2.small diff --git a/tests/translator/input/capacity_provider_minimal.yaml b/tests/translator/input/capacity_provider_minimal.yaml index 0355d27de..6b0f412b6 100644 --- a/tests/translator/input/capacity_provider_minimal.yaml +++ b/tests/translator/input/capacity_provider_minimal.yaml @@ -9,3 +9,5 @@ Resources: VpcConfig: SubnetIds: - subnet-12345678 + SecurityGroupIds: + - sg-12345678 diff --git a/tests/translator/input/capacity_provider_with_intrinsics.yaml b/tests/translator/input/capacity_provider_with_intrinsics.yaml index 1fffa1ab2..f2e483c04 100644 --- a/tests/translator/input/capacity_provider_with_intrinsics.yaml +++ b/tests/translator/input/capacity_provider_with_intrinsics.yaml @@ -39,7 +39,7 @@ Parameters: Type: Number Default: 81.2 - KMSKeyArn: + KmsKeyArn: Type: String Default: arn:aws:kms:us-east-1:123456789012:key/abcd1234-ef56-gh78-ij90-klmnopqrstuv @@ -65,4 +65,4 @@ Resources: ScalingConfig: MaxVCpuCount: !Ref MaxVCpuCount AverageCPUUtilization: !Ref TargetCPU - KMSKeyArn: !Ref KMSKeyArn + KmsKeyArn: !Ref KmsKeyArn diff --git a/tests/translator/input/error_capacity_provider_typo_properties.yaml b/tests/translator/input/error_capacity_provider_typo_properties.yaml index 16f44c25c..176381776 100644 --- a/tests/translator/input/error_capacity_provider_typo_properties.yaml +++ b/tests/translator/input/error_capacity_provider_typo_properties.yaml @@ -15,4 +15,5 @@ Resources: - subnet-87654321 ScalingConfg: # Typo: missing 'i' MaxVCpuCount: 10 - KMSKeyArn: arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012 # Typo: should be KMSKeyArn + KMSKeyArn: arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012 # Typo: should be KmsKeyArn +# This test will actually fail only with the first error, so the rest are just ignored diff --git a/tests/translator/input/function_with_capacity_provider_and_autopublish.yaml b/tests/translator/input/function_with_capacity_provider_and_autopublish.yaml index 3ea2cf91a..efadcea9b 100644 --- a/tests/translator/input/function_with_capacity_provider_and_autopublish.yaml +++ b/tests/translator/input/function_with_capacity_provider_and_autopublish.yaml @@ -14,7 +14,7 @@ Resources: Timeout: 30 AutoPublishAlias: Production CapacityProviderConfig: - Arn: arn:aws:lambda:us-east-1:123456789012:capacity-provider/test-capacity-provider + Arn: arn:aws:lambda:us-east-1:123456789012:capacity-provider:test-capacity-provider PerExecutionEnvironmentMaxConcurrency: 50 FunctionScalingConfig: MinExecutionEnvironments: 2 diff --git a/tests/translator/input/function_with_capacity_provider_full.yaml b/tests/translator/input/function_with_capacity_provider_full.yaml index f5e9a9c4c..695c682c1 100644 --- a/tests/translator/input/function_with_capacity_provider_full.yaml +++ b/tests/translator/input/function_with_capacity_provider_full.yaml @@ -17,7 +17,7 @@ Resources: Variables: ENVIRONMENT: production CapacityProviderConfig: - Arn: arn:aws:lambda:us-east-1:123456789012:capacity-provider/test-capacity-provider + Arn: arn:aws:lambda:us-east-1:123456789012:capacity-provider:test-capacity-provider PerExecutionEnvironmentMaxConcurrency: 100 ExecutionEnvironmentMemoryGiBPerVCpu: 4.0 FunctionScalingConfig: diff --git a/tests/translator/input/function_with_capacity_provider_minimal.yaml b/tests/translator/input/function_with_capacity_provider_minimal.yaml index cab1c364b..588306331 100644 --- a/tests/translator/input/function_with_capacity_provider_minimal.yaml +++ b/tests/translator/input/function_with_capacity_provider_minimal.yaml @@ -10,4 +10,4 @@ Resources: Handler: hello.handler Runtime: python3.12 CapacityProviderConfig: - Arn: arn:aws:lambda:us-east-1:123456789012:capacity-provider/test-capacity-provider + Arn: arn:aws:lambda:us-east-1:123456789012:capacity-provider:test-capacity-provider diff --git a/tests/translator/output/aws-cn/capacity_provider_full.json b/tests/translator/output/aws-cn/capacity_provider_full.json index ec960ea29..386bd0ca1 100644 --- a/tests/translator/output/aws-cn/capacity_provider_full.json +++ b/tests/translator/output/aws-cn/capacity_provider_full.json @@ -4,7 +4,7 @@ "Resources": { "CapacityProviderTwo": { "Properties": { - "CapacityProviderName": "customized-capacity-provider", + "CapacityProviderName": "customized-capacity-provider2", "CapacityProviderScalingConfig": { "ScalingMode": "Manual", "ScalingPolicies": [ @@ -14,7 +14,7 @@ } ] }, - "KMSKeyArn": "arn:aws:kms:us-east-1:123456789012:key/abcd1234-ef56-gh78-ij90-klmnopqrstuv", + "KmsKeyArn": "arn:aws:kms:us-east-1:123456789012:key/abcd1234-ef56-gh78-ij90-klmnopqrstuv", "PermissionsConfig": { "CapacityProviderOperatorRoleArn": { "Fn::GetAtt": [ @@ -93,7 +93,7 @@ "arm64" ] }, - "KMSKeyArn": "arn:aws:kms:us-east-1:123456789012:key/abcd1234-ef56-gh78-ij90-klmnopqrstuv", + "KmsKeyArn": "arn:aws:kms:us-east-1:123456789012:key/abcd1234-ef56-gh78-ij90-klmnopqrstuv", "PermissionsConfig": { "CapacityProviderOperatorRoleArn": { "Fn::GetAtt": [ @@ -169,7 +169,7 @@ "c5.xlarge" ] }, - "KMSKeyArn": "arn:aws:kms:us-east-1:123456789012:key/abcd1234-ef56-gh78-ij90-klmnopqrstuv", + "KmsKeyArn": "arn:aws:kms:us-east-1:123456789012:key/abcd1234-ef56-gh78-ij90-klmnopqrstuv", "PermissionsConfig": { "CapacityProviderOperatorRoleArn": { "Fn::GetAtt": [ diff --git a/tests/translator/output/aws-cn/capacity_provider_global_with_functions.json b/tests/translator/output/aws-cn/capacity_provider_global_with_functions.json index 83b98485c..7014b43d2 100644 --- a/tests/translator/output/aws-cn/capacity_provider_global_with_functions.json +++ b/tests/translator/output/aws-cn/capacity_provider_global_with_functions.json @@ -217,15 +217,14 @@ }, "InstanceRequirements": { "Architectures": [ - "x86_64", - "arm64" + "x86_64" ], "ExcludedInstanceTypes": [ "t2.micro", "t2.small" ] }, - "KMSKeyArn": "some-kms-arn", + "KmsKeyArn": "some-kms-arn", "PermissionsConfig": { "CapacityProviderOperatorRoleArn": { "Fn::GetAtt": [ diff --git a/tests/translator/output/aws-cn/capacity_provider_minimal.json b/tests/translator/output/aws-cn/capacity_provider_minimal.json index 82053514b..d1541e098 100644 --- a/tests/translator/output/aws-cn/capacity_provider_minimal.json +++ b/tests/translator/output/aws-cn/capacity_provider_minimal.json @@ -19,6 +19,9 @@ } ], "VpcConfig": { + "SecurityGroupIds": [ + "sg-12345678" + ], "SubnetIds": [ "subnet-12345678" ] diff --git a/tests/translator/output/aws-cn/capacity_provider_with_intrinsics.json b/tests/translator/output/aws-cn/capacity_provider_with_intrinsics.json index 23b39ec2d..3fbaf161c 100644 --- a/tests/translator/output/aws-cn/capacity_provider_with_intrinsics.json +++ b/tests/translator/output/aws-cn/capacity_provider_with_intrinsics.json @@ -18,7 +18,7 @@ "Default": "t2.micro", "Type": "String" }, - "KMSKeyArn": { + "KmsKeyArn": { "Default": "arn:aws:kms:us-east-1:123456789012:key/abcd1234-ef56-gh78-ij90-klmnopqrstuv", "Type": "String" }, @@ -84,8 +84,8 @@ } ] }, - "KMSKeyArn": { - "Ref": "KMSKeyArn" + "KmsKeyArn": { + "Ref": "KmsKeyArn" }, "PermissionsConfig": { "CapacityProviderOperatorRoleArn": { diff --git a/tests/translator/output/aws-cn/function_with_capacity_provider_and_autopublish.json b/tests/translator/output/aws-cn/function_with_capacity_provider_and_autopublish.json index f80b631ea..f4675238a 100644 --- a/tests/translator/output/aws-cn/function_with_capacity_provider_and_autopublish.json +++ b/tests/translator/output/aws-cn/function_with_capacity_provider_and_autopublish.json @@ -30,7 +30,7 @@ "Properties": { "CapacityProviderConfig": { "LambdaManagedInstancesCapacityProviderConfig": { - "CapacityProviderArn": "arn:aws:lambda:us-east-1:123456789012:capacity-provider/test-capacity-provider", + "CapacityProviderArn": "arn:aws:lambda:us-east-1:123456789012:capacity-provider:test-capacity-provider", "PerExecutionEnvironmentMaxConcurrency": 50 } }, diff --git a/tests/translator/output/aws-cn/function_with_capacity_provider_full.json b/tests/translator/output/aws-cn/function_with_capacity_provider_full.json index 6f1edf59c..7013b387f 100644 --- a/tests/translator/output/aws-cn/function_with_capacity_provider_full.json +++ b/tests/translator/output/aws-cn/function_with_capacity_provider_full.json @@ -6,7 +6,7 @@ "Properties": { "CapacityProviderConfig": { "LambdaManagedInstancesCapacityProviderConfig": { - "CapacityProviderArn": "arn:aws:lambda:us-east-1:123456789012:capacity-provider/test-capacity-provider", + "CapacityProviderArn": "arn:aws:lambda:us-east-1:123456789012:capacity-provider:test-capacity-provider", "ExecutionEnvironmentMemoryGiBPerVCpu": 4, "PerExecutionEnvironmentMaxConcurrency": 100 } diff --git a/tests/translator/output/aws-cn/function_with_capacity_provider_minimal.json b/tests/translator/output/aws-cn/function_with_capacity_provider_minimal.json index 77b8c779b..6b7de1b7f 100644 --- a/tests/translator/output/aws-cn/function_with_capacity_provider_minimal.json +++ b/tests/translator/output/aws-cn/function_with_capacity_provider_minimal.json @@ -6,7 +6,7 @@ "Properties": { "CapacityProviderConfig": { "LambdaManagedInstancesCapacityProviderConfig": { - "CapacityProviderArn": "arn:aws:lambda:us-east-1:123456789012:capacity-provider/test-capacity-provider" + "CapacityProviderArn": "arn:aws:lambda:us-east-1:123456789012:capacity-provider:test-capacity-provider" } }, "Code": { diff --git a/tests/translator/output/aws-us-gov/capacity_provider_full.json b/tests/translator/output/aws-us-gov/capacity_provider_full.json index e4c4d5141..c322b52fd 100644 --- a/tests/translator/output/aws-us-gov/capacity_provider_full.json +++ b/tests/translator/output/aws-us-gov/capacity_provider_full.json @@ -4,7 +4,7 @@ "Resources": { "CapacityProviderTwo": { "Properties": { - "CapacityProviderName": "customized-capacity-provider", + "CapacityProviderName": "customized-capacity-provider2", "CapacityProviderScalingConfig": { "ScalingMode": "Manual", "ScalingPolicies": [ @@ -14,7 +14,7 @@ } ] }, - "KMSKeyArn": "arn:aws:kms:us-east-1:123456789012:key/abcd1234-ef56-gh78-ij90-klmnopqrstuv", + "KmsKeyArn": "arn:aws:kms:us-east-1:123456789012:key/abcd1234-ef56-gh78-ij90-klmnopqrstuv", "PermissionsConfig": { "CapacityProviderOperatorRoleArn": { "Fn::GetAtt": [ @@ -93,7 +93,7 @@ "arm64" ] }, - "KMSKeyArn": "arn:aws:kms:us-east-1:123456789012:key/abcd1234-ef56-gh78-ij90-klmnopqrstuv", + "KmsKeyArn": "arn:aws:kms:us-east-1:123456789012:key/abcd1234-ef56-gh78-ij90-klmnopqrstuv", "PermissionsConfig": { "CapacityProviderOperatorRoleArn": { "Fn::GetAtt": [ @@ -169,7 +169,7 @@ "c5.xlarge" ] }, - "KMSKeyArn": "arn:aws:kms:us-east-1:123456789012:key/abcd1234-ef56-gh78-ij90-klmnopqrstuv", + "KmsKeyArn": "arn:aws:kms:us-east-1:123456789012:key/abcd1234-ef56-gh78-ij90-klmnopqrstuv", "PermissionsConfig": { "CapacityProviderOperatorRoleArn": { "Fn::GetAtt": [ diff --git a/tests/translator/output/aws-us-gov/capacity_provider_global_with_functions.json b/tests/translator/output/aws-us-gov/capacity_provider_global_with_functions.json index a241cd279..f83fbe01c 100644 --- a/tests/translator/output/aws-us-gov/capacity_provider_global_with_functions.json +++ b/tests/translator/output/aws-us-gov/capacity_provider_global_with_functions.json @@ -217,15 +217,14 @@ }, "InstanceRequirements": { "Architectures": [ - "x86_64", - "arm64" + "x86_64" ], "ExcludedInstanceTypes": [ "t2.micro", "t2.small" ] }, - "KMSKeyArn": "some-kms-arn", + "KmsKeyArn": "some-kms-arn", "PermissionsConfig": { "CapacityProviderOperatorRoleArn": { "Fn::GetAtt": [ diff --git a/tests/translator/output/aws-us-gov/capacity_provider_minimal.json b/tests/translator/output/aws-us-gov/capacity_provider_minimal.json index a48181742..3211d6374 100644 --- a/tests/translator/output/aws-us-gov/capacity_provider_minimal.json +++ b/tests/translator/output/aws-us-gov/capacity_provider_minimal.json @@ -19,6 +19,9 @@ } ], "VpcConfig": { + "SecurityGroupIds": [ + "sg-12345678" + ], "SubnetIds": [ "subnet-12345678" ] diff --git a/tests/translator/output/aws-us-gov/capacity_provider_with_intrinsics.json b/tests/translator/output/aws-us-gov/capacity_provider_with_intrinsics.json index c43f074d6..4ceae3612 100644 --- a/tests/translator/output/aws-us-gov/capacity_provider_with_intrinsics.json +++ b/tests/translator/output/aws-us-gov/capacity_provider_with_intrinsics.json @@ -18,7 +18,7 @@ "Default": "t2.micro", "Type": "String" }, - "KMSKeyArn": { + "KmsKeyArn": { "Default": "arn:aws:kms:us-east-1:123456789012:key/abcd1234-ef56-gh78-ij90-klmnopqrstuv", "Type": "String" }, @@ -84,8 +84,8 @@ } ] }, - "KMSKeyArn": { - "Ref": "KMSKeyArn" + "KmsKeyArn": { + "Ref": "KmsKeyArn" }, "PermissionsConfig": { "CapacityProviderOperatorRoleArn": { diff --git a/tests/translator/output/aws-us-gov/function_with_capacity_provider_and_autopublish.json b/tests/translator/output/aws-us-gov/function_with_capacity_provider_and_autopublish.json index 87d462ace..24c9f7b76 100644 --- a/tests/translator/output/aws-us-gov/function_with_capacity_provider_and_autopublish.json +++ b/tests/translator/output/aws-us-gov/function_with_capacity_provider_and_autopublish.json @@ -30,7 +30,7 @@ "Properties": { "CapacityProviderConfig": { "LambdaManagedInstancesCapacityProviderConfig": { - "CapacityProviderArn": "arn:aws:lambda:us-east-1:123456789012:capacity-provider/test-capacity-provider", + "CapacityProviderArn": "arn:aws:lambda:us-east-1:123456789012:capacity-provider:test-capacity-provider", "PerExecutionEnvironmentMaxConcurrency": 50 } }, diff --git a/tests/translator/output/aws-us-gov/function_with_capacity_provider_full.json b/tests/translator/output/aws-us-gov/function_with_capacity_provider_full.json index e5ec8fc11..295c4eaf7 100644 --- a/tests/translator/output/aws-us-gov/function_with_capacity_provider_full.json +++ b/tests/translator/output/aws-us-gov/function_with_capacity_provider_full.json @@ -6,7 +6,7 @@ "Properties": { "CapacityProviderConfig": { "LambdaManagedInstancesCapacityProviderConfig": { - "CapacityProviderArn": "arn:aws:lambda:us-east-1:123456789012:capacity-provider/test-capacity-provider", + "CapacityProviderArn": "arn:aws:lambda:us-east-1:123456789012:capacity-provider:test-capacity-provider", "ExecutionEnvironmentMemoryGiBPerVCpu": 4, "PerExecutionEnvironmentMaxConcurrency": 100 } diff --git a/tests/translator/output/aws-us-gov/function_with_capacity_provider_minimal.json b/tests/translator/output/aws-us-gov/function_with_capacity_provider_minimal.json index 7e6443bae..764ef698f 100644 --- a/tests/translator/output/aws-us-gov/function_with_capacity_provider_minimal.json +++ b/tests/translator/output/aws-us-gov/function_with_capacity_provider_minimal.json @@ -6,7 +6,7 @@ "Properties": { "CapacityProviderConfig": { "LambdaManagedInstancesCapacityProviderConfig": { - "CapacityProviderArn": "arn:aws:lambda:us-east-1:123456789012:capacity-provider/test-capacity-provider" + "CapacityProviderArn": "arn:aws:lambda:us-east-1:123456789012:capacity-provider:test-capacity-provider" } }, "Code": { diff --git a/tests/translator/output/capacity_provider_full.json b/tests/translator/output/capacity_provider_full.json index 992b088b3..ed344bbae 100644 --- a/tests/translator/output/capacity_provider_full.json +++ b/tests/translator/output/capacity_provider_full.json @@ -4,7 +4,7 @@ "Resources": { "CapacityProviderTwo": { "Properties": { - "CapacityProviderName": "customized-capacity-provider", + "CapacityProviderName": "customized-capacity-provider2", "CapacityProviderScalingConfig": { "ScalingMode": "Manual", "ScalingPolicies": [ @@ -14,7 +14,7 @@ } ] }, - "KMSKeyArn": "arn:aws:kms:us-east-1:123456789012:key/abcd1234-ef56-gh78-ij90-klmnopqrstuv", + "KmsKeyArn": "arn:aws:kms:us-east-1:123456789012:key/abcd1234-ef56-gh78-ij90-klmnopqrstuv", "PermissionsConfig": { "CapacityProviderOperatorRoleArn": { "Fn::GetAtt": [ @@ -93,7 +93,7 @@ "arm64" ] }, - "KMSKeyArn": "arn:aws:kms:us-east-1:123456789012:key/abcd1234-ef56-gh78-ij90-klmnopqrstuv", + "KmsKeyArn": "arn:aws:kms:us-east-1:123456789012:key/abcd1234-ef56-gh78-ij90-klmnopqrstuv", "PermissionsConfig": { "CapacityProviderOperatorRoleArn": { "Fn::GetAtt": [ @@ -169,7 +169,7 @@ "c5.xlarge" ] }, - "KMSKeyArn": "arn:aws:kms:us-east-1:123456789012:key/abcd1234-ef56-gh78-ij90-klmnopqrstuv", + "KmsKeyArn": "arn:aws:kms:us-east-1:123456789012:key/abcd1234-ef56-gh78-ij90-klmnopqrstuv", "PermissionsConfig": { "CapacityProviderOperatorRoleArn": { "Fn::GetAtt": [ diff --git a/tests/translator/output/capacity_provider_global_with_functions.json b/tests/translator/output/capacity_provider_global_with_functions.json index 41dbf901a..b938bc145 100644 --- a/tests/translator/output/capacity_provider_global_with_functions.json +++ b/tests/translator/output/capacity_provider_global_with_functions.json @@ -217,15 +217,14 @@ }, "InstanceRequirements": { "Architectures": [ - "x86_64", - "arm64" + "x86_64" ], "ExcludedInstanceTypes": [ "t2.micro", "t2.small" ] }, - "KMSKeyArn": "some-kms-arn", + "KmsKeyArn": "some-kms-arn", "PermissionsConfig": { "CapacityProviderOperatorRoleArn": { "Fn::GetAtt": [ diff --git a/tests/translator/output/capacity_provider_minimal.json b/tests/translator/output/capacity_provider_minimal.json index b2c936f4f..e1254261d 100644 --- a/tests/translator/output/capacity_provider_minimal.json +++ b/tests/translator/output/capacity_provider_minimal.json @@ -19,6 +19,9 @@ } ], "VpcConfig": { + "SecurityGroupIds": [ + "sg-12345678" + ], "SubnetIds": [ "subnet-12345678" ] diff --git a/tests/translator/output/capacity_provider_with_intrinsics.json b/tests/translator/output/capacity_provider_with_intrinsics.json index 46e89ae04..05e55e80c 100644 --- a/tests/translator/output/capacity_provider_with_intrinsics.json +++ b/tests/translator/output/capacity_provider_with_intrinsics.json @@ -18,7 +18,7 @@ "Default": "t2.micro", "Type": "String" }, - "KMSKeyArn": { + "KmsKeyArn": { "Default": "arn:aws:kms:us-east-1:123456789012:key/abcd1234-ef56-gh78-ij90-klmnopqrstuv", "Type": "String" }, @@ -84,8 +84,8 @@ } ] }, - "KMSKeyArn": { - "Ref": "KMSKeyArn" + "KmsKeyArn": { + "Ref": "KmsKeyArn" }, "PermissionsConfig": { "CapacityProviderOperatorRoleArn": { diff --git a/tests/translator/output/error_global_capacity_provider_unsupported.json b/tests/translator/output/error_global_capacity_provider_unsupported.json index 4838c6101..40e5f5329 100644 --- a/tests/translator/output/error_global_capacity_provider_unsupported.json +++ b/tests/translator/output/error_global_capacity_provider_unsupported.json @@ -4,7 +4,7 @@ "Number of errors found: 1. ", "'Globals' section is invalid. ", "'CapacityProviderName' is not a supported property of 'CapacityProvider'. ", - "Must be one of the following values - ['VpcConfig', 'OperatorRole', 'Tags', 'InstanceRequirements', 'ScalingConfig', 'KMSKeyArn', 'PropagateTags']" + "Must be one of the following values - ['VpcConfig', 'OperatorRole', 'Tags', 'InstanceRequirements', 'ScalingConfig', 'KmsKeyArn', 'PropagateTags']" ], - "errorMessage": "Invalid Serverless Application Specification document. Number of errors found: 1. 'Globals' section is invalid. 'CapacityProviderName' is not a supported property of 'CapacityProvider'. Must be one of the following values - ['VpcConfig', 'OperatorRole', 'Tags', 'InstanceRequirements', 'ScalingConfig', 'KMSKeyArn', 'PropagateTags']" + "errorMessage": "Invalid Serverless Application Specification document. Number of errors found: 1. 'Globals' section is invalid. 'CapacityProviderName' is not a supported property of 'CapacityProvider'. Must be one of the following values - ['VpcConfig', 'OperatorRole', 'Tags', 'InstanceRequirements', 'ScalingConfig', 'KmsKeyArn', 'PropagateTags']" } diff --git a/tests/translator/output/function_with_capacity_provider_and_autopublish.json b/tests/translator/output/function_with_capacity_provider_and_autopublish.json index b89dbf445..69d1ab56d 100644 --- a/tests/translator/output/function_with_capacity_provider_and_autopublish.json +++ b/tests/translator/output/function_with_capacity_provider_and_autopublish.json @@ -30,7 +30,7 @@ "Properties": { "CapacityProviderConfig": { "LambdaManagedInstancesCapacityProviderConfig": { - "CapacityProviderArn": "arn:aws:lambda:us-east-1:123456789012:capacity-provider/test-capacity-provider", + "CapacityProviderArn": "arn:aws:lambda:us-east-1:123456789012:capacity-provider:test-capacity-provider", "PerExecutionEnvironmentMaxConcurrency": 50 } }, diff --git a/tests/translator/output/function_with_capacity_provider_full.json b/tests/translator/output/function_with_capacity_provider_full.json index e922c5cea..1d503f9be 100644 --- a/tests/translator/output/function_with_capacity_provider_full.json +++ b/tests/translator/output/function_with_capacity_provider_full.json @@ -6,7 +6,7 @@ "Properties": { "CapacityProviderConfig": { "LambdaManagedInstancesCapacityProviderConfig": { - "CapacityProviderArn": "arn:aws:lambda:us-east-1:123456789012:capacity-provider/test-capacity-provider", + "CapacityProviderArn": "arn:aws:lambda:us-east-1:123456789012:capacity-provider:test-capacity-provider", "ExecutionEnvironmentMemoryGiBPerVCpu": 4, "PerExecutionEnvironmentMaxConcurrency": 100 } diff --git a/tests/translator/output/function_with_capacity_provider_minimal.json b/tests/translator/output/function_with_capacity_provider_minimal.json index 2fc4e979f..03fef1daa 100644 --- a/tests/translator/output/function_with_capacity_provider_minimal.json +++ b/tests/translator/output/function_with_capacity_provider_minimal.json @@ -6,7 +6,7 @@ "Properties": { "CapacityProviderConfig": { "LambdaManagedInstancesCapacityProviderConfig": { - "CapacityProviderArn": "arn:aws:lambda:us-east-1:123456789012:capacity-provider/test-capacity-provider" + "CapacityProviderArn": "arn:aws:lambda:us-east-1:123456789012:capacity-provider:test-capacity-provider" } }, "Code": {