-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* feature: add support for CFN fields for lambda signing (#53) * feature: add support for CFN fields for lambda signing * feature: add support for CFN fields for lambda signing (update formatting) * feature: add support for CFN fields for lambda signing (update patching) * feature: add support for CFN fields for lambda signing (update template) * Revert "feat: add explicit UpdateReplacePolicy (#1481)" (#1568) * docs: document IpV6 option on Domain Configuration object (#1588) * chore: Exclude test modules in whl (#1597) * feat: Add Step Function Resource (#1601) Co-authored-by: Jacob Fuss <[email protected]> * Release Changes for 1.25.0 * feature: add support for CFN fields for lambda signing * feature: add support for CFN fields for lambda signing (slight code update) * feature: add support for CFN fields for lambda signing (update globals.py) Co-authored-by: Shreya <[email protected]> Co-authored-by: Timo Schilling <[email protected]> Co-authored-by: Jacob Fuss <[email protected]> Co-authored-by: Jacob Fuss <[email protected]> Co-authored-by: Alex Wood <[email protected]> * Move Tests to Appveyor (#1801) * print python version * update path vars * update linux cmd * update linux cmd * update linux cmd * update whitelist in tox * update passenv * update tox whitelisting * update tox whitelisting Co-authored-by: Shreya <[email protected]> Co-authored-by: Timo Schilling <[email protected]> Co-authored-by: Jacob Fuss <[email protected]> Co-authored-by: Jacob Fuss <[email protected]> Co-authored-by: Alex Wood <[email protected]>
- Loading branch information
1 parent
f6d9c8c
commit 13b61c5
Showing
10 changed files
with
318 additions
and
2 deletions.
There are no files selected for viewing
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
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
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
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,24 @@ | ||
Resources: | ||
|
||
FunctionWithSigningProfile: | ||
Type: AWS::Serverless::Function | ||
Properties: | ||
CodeUri: s3://sam-demo-bucket/member_portal.zip | ||
Handler: index.gethtml | ||
Runtime: nodejs12.x | ||
CodeSigningConfigArn: !Ref MySignedFunctionCodeSigningConfig | ||
|
||
MySignedFunctionCodeSigningConfig: | ||
Type: AWS::Lambda::CodeSigningConfig | ||
Properties: | ||
Description: "Code Signing for MySignedLambdaFunction" | ||
AllowedPublishers: | ||
SigningProfileVersionArns: | ||
- !GetAtt SigningProfile.ProfileVersionArn | ||
CodeSigningPolicies: | ||
UntrustedArtifactOnDeployment: "Enforce" | ||
|
||
SigningProfile: | ||
Type: AWS::Signer::SigningProfile | ||
Properties: | ||
PlatformId: AWSLambda-SHA384-ECDSA |
85 changes: 85 additions & 0 deletions
85
tests/translator/output/aws-cn/function_with_signing_profile.json
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,85 @@ | ||
{ | ||
"Resources": { | ||
"FunctionWithSigningProfile": { | ||
"Type": "AWS::Lambda::Function", | ||
"Properties": { | ||
"Handler": "index.gethtml", | ||
"Code": { | ||
"S3Bucket": "sam-demo-bucket", | ||
"S3Key": "member_portal.zip" | ||
}, | ||
"Runtime": "nodejs12.x", | ||
"Tags": [ | ||
{ | ||
"Value": "SAM", | ||
"Key": "lambda:createdBy" | ||
} | ||
], | ||
"Role": { | ||
"Fn::GetAtt": [ | ||
"FunctionWithSigningProfileRole", | ||
"Arn" | ||
] | ||
}, | ||
"CodeSigningConfigArn": { | ||
"Ref": "MySignedFunctionCodeSigningConfig" | ||
} | ||
} | ||
}, | ||
"FunctionWithSigningProfileRole": { | ||
"Type": "AWS::IAM::Role", | ||
"Properties": { | ||
"AssumeRolePolicyDocument": { | ||
"Version": "2012-10-17", | ||
"Statement": [ | ||
{ | ||
"Action": [ | ||
"sts:AssumeRole" | ||
], | ||
"Effect": "Allow", | ||
"Principal": { | ||
"Service": [ | ||
"lambda.amazonaws.com" | ||
] | ||
} | ||
} | ||
] | ||
}, | ||
"ManagedPolicyArns": [ | ||
"arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" | ||
], | ||
"Tags": [ | ||
{ | ||
"Value": "SAM", | ||
"Key": "lambda:createdBy" | ||
} | ||
] | ||
} | ||
}, | ||
"MySignedFunctionCodeSigningConfig": { | ||
"Type": "AWS::Lambda::CodeSigningConfig", | ||
"Properties": { | ||
"CodeSigningPolicies": { | ||
"UntrustedArtifactOnDeployment": "Enforce" | ||
}, | ||
"AllowedPublishers": { | ||
"SigningProfileVersionArns": [ | ||
{ | ||
"Fn::GetAtt": [ | ||
"SigningProfile", | ||
"ProfileVersionArn" | ||
] | ||
} | ||
] | ||
}, | ||
"Description": "Code Signing for MySignedLambdaFunction" | ||
} | ||
}, | ||
"SigningProfile": { | ||
"Type": "AWS::Signer::SigningProfile", | ||
"Properties": { | ||
"PlatformId": "AWSLambda-SHA384-ECDSA" | ||
} | ||
} | ||
} | ||
} |
85 changes: 85 additions & 0 deletions
85
tests/translator/output/aws-us-gov/function_with_signing_profile.json
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,85 @@ | ||
{ | ||
"Resources": { | ||
"FunctionWithSigningProfile": { | ||
"Type": "AWS::Lambda::Function", | ||
"Properties": { | ||
"Handler": "index.gethtml", | ||
"Code": { | ||
"S3Bucket": "sam-demo-bucket", | ||
"S3Key": "member_portal.zip" | ||
}, | ||
"Runtime": "nodejs12.x", | ||
"Tags": [ | ||
{ | ||
"Value": "SAM", | ||
"Key": "lambda:createdBy" | ||
} | ||
], | ||
"Role": { | ||
"Fn::GetAtt": [ | ||
"FunctionWithSigningProfileRole", | ||
"Arn" | ||
] | ||
}, | ||
"CodeSigningConfigArn": { | ||
"Ref": "MySignedFunctionCodeSigningConfig" | ||
} | ||
} | ||
}, | ||
"FunctionWithSigningProfileRole": { | ||
"Type": "AWS::IAM::Role", | ||
"Properties": { | ||
"AssumeRolePolicyDocument": { | ||
"Version": "2012-10-17", | ||
"Statement": [ | ||
{ | ||
"Action": [ | ||
"sts:AssumeRole" | ||
], | ||
"Effect": "Allow", | ||
"Principal": { | ||
"Service": [ | ||
"lambda.amazonaws.com" | ||
] | ||
} | ||
} | ||
] | ||
}, | ||
"ManagedPolicyArns": [ | ||
"arn:aws-us-gov:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" | ||
], | ||
"Tags": [ | ||
{ | ||
"Value": "SAM", | ||
"Key": "lambda:createdBy" | ||
} | ||
] | ||
} | ||
}, | ||
"MySignedFunctionCodeSigningConfig": { | ||
"Type": "AWS::Lambda::CodeSigningConfig", | ||
"Properties": { | ||
"CodeSigningPolicies": { | ||
"UntrustedArtifactOnDeployment": "Enforce" | ||
}, | ||
"AllowedPublishers": { | ||
"SigningProfileVersionArns": [ | ||
{ | ||
"Fn::GetAtt": [ | ||
"SigningProfile", | ||
"ProfileVersionArn" | ||
] | ||
} | ||
] | ||
}, | ||
"Description": "Code Signing for MySignedLambdaFunction" | ||
} | ||
}, | ||
"SigningProfile": { | ||
"Type": "AWS::Signer::SigningProfile", | ||
"Properties": { | ||
"PlatformId": "AWSLambda-SHA384-ECDSA" | ||
} | ||
} | ||
} | ||
} |
4 changes: 2 additions & 2 deletions
4
tests/translator/output/error_globals_unsupported_property.json
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 |
---|---|---|
@@ -1,8 +1,8 @@ | ||
{ | ||
"errors": [ | ||
{ | ||
"errorMessage": "'Globals' section is invalid. 'SomeKey' is not a supported property of 'Function'. Must be one of the following values - ['Handler', 'Runtime', 'CodeUri', 'DeadLetterQueue', 'Description', 'MemorySize', 'Timeout', 'VpcConfig', 'Environment', 'Tags', 'Tracing', 'KmsKeyArn', 'AutoPublishAlias', 'Layers', 'DeploymentPreference', 'PermissionsBoundary', 'ReservedConcurrentExecutions', 'ProvisionedConcurrencyConfig', 'EventInvokeConfig', 'FileSystemConfigs']" | ||
"errorMessage": "'Globals' section is invalid. 'SomeKey' is not a supported property of 'Function'. Must be one of the following values - ['Handler', 'Runtime', 'CodeUri', 'DeadLetterQueue', 'Description', 'MemorySize', 'Timeout', 'VpcConfig', 'Environment', 'Tags', 'Tracing', 'KmsKeyArn', 'AutoPublishAlias', 'Layers', 'DeploymentPreference', 'PermissionsBoundary', 'ReservedConcurrentExecutions', 'ProvisionedConcurrencyConfig', 'EventInvokeConfig', 'FileSystemConfigs', 'CodeSigningConfigArn']" | ||
} | ||
], | ||
"errorMessage": "Invalid Serverless Application Specification document. Number of errors found: 1. 'Globals' section is invalid. 'SomeKey' is not a supported property of 'Function'. Must be one of the following values - ['Handler', 'Runtime', 'CodeUri', 'DeadLetterQueue', 'Description', 'MemorySize', 'Timeout', 'VpcConfig', 'Environment', 'Tags', 'Tracing', 'KmsKeyArn', 'AutoPublishAlias', 'Layers', 'DeploymentPreference', 'PermissionsBoundary', 'ReservedConcurrentExecutions', 'ProvisionedConcurrencyConfig', 'AssumeRolePolicyDocument', 'EventInvokeConfig', 'FileSystemConfigs']" | ||
"errorMessage": "Invalid Serverless Application Specification document. Number of errors found: 1. 'Globals' section is invalid. 'SomeKey' is not a supported property of 'Function'. Must be one of the following values - ['Handler', 'Runtime', 'CodeUri', 'DeadLetterQueue', 'Description', 'MemorySize', 'Timeout', 'VpcConfig', 'Environment', 'Tags', 'Tracing', 'KmsKeyArn', 'AutoPublishAlias', 'Layers', 'DeploymentPreference', 'PermissionsBoundary', 'ReservedConcurrentExecutions', 'ProvisionedConcurrencyConfig', 'AssumeRolePolicyDocument', 'EventInvokeConfig', 'FileSystemConfigs', 'CodeSigningConfigArn']" | ||
} |
85 changes: 85 additions & 0 deletions
85
tests/translator/output/function_with_signing_profile.json
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,85 @@ | ||
{ | ||
"Resources": { | ||
"FunctionWithSigningProfile": { | ||
"Type": "AWS::Lambda::Function", | ||
"Properties": { | ||
"Handler": "index.gethtml", | ||
"Code": { | ||
"S3Bucket": "sam-demo-bucket", | ||
"S3Key": "member_portal.zip" | ||
}, | ||
"Runtime": "nodejs12.x", | ||
"Tags": [ | ||
{ | ||
"Value": "SAM", | ||
"Key": "lambda:createdBy" | ||
} | ||
], | ||
"Role": { | ||
"Fn::GetAtt": [ | ||
"FunctionWithSigningProfileRole", | ||
"Arn" | ||
] | ||
}, | ||
"CodeSigningConfigArn": { | ||
"Ref": "MySignedFunctionCodeSigningConfig" | ||
} | ||
} | ||
}, | ||
"FunctionWithSigningProfileRole": { | ||
"Type": "AWS::IAM::Role", | ||
"Properties": { | ||
"AssumeRolePolicyDocument": { | ||
"Version": "2012-10-17", | ||
"Statement": [ | ||
{ | ||
"Action": [ | ||
"sts:AssumeRole" | ||
], | ||
"Effect": "Allow", | ||
"Principal": { | ||
"Service": [ | ||
"lambda.amazonaws.com" | ||
] | ||
} | ||
} | ||
] | ||
}, | ||
"ManagedPolicyArns": [ | ||
"arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" | ||
], | ||
"Tags": [ | ||
{ | ||
"Value": "SAM", | ||
"Key": "lambda:createdBy" | ||
} | ||
] | ||
} | ||
}, | ||
"MySignedFunctionCodeSigningConfig": { | ||
"Type": "AWS::Lambda::CodeSigningConfig", | ||
"Properties": { | ||
"CodeSigningPolicies": { | ||
"UntrustedArtifactOnDeployment": "Enforce" | ||
}, | ||
"AllowedPublishers": { | ||
"SigningProfileVersionArns": [ | ||
{ | ||
"Fn::GetAtt": [ | ||
"SigningProfile", | ||
"ProfileVersionArn" | ||
] | ||
} | ||
] | ||
}, | ||
"Description": "Code Signing for MySignedLambdaFunction" | ||
} | ||
}, | ||
"SigningProfile": { | ||
"Type": "AWS::Signer::SigningProfile", | ||
"Properties": { | ||
"PlatformId": "AWSLambda-SHA384-ECDSA" | ||
} | ||
} | ||
} | ||
} |
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
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