-
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.
fix: Support resolve simple ref intrinsics for Tracing Properties and…
… Fix Bugs in Tracing Properties
- Loading branch information
Showing
9 changed files
with
870 additions
and
29 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
Parameters: | ||
TracingParamPassThrough: | ||
Type: String | ||
Default: PassThrough | ||
TracingParamActive: | ||
Type: String | ||
Default: Active | ||
|
||
Resources: | ||
ActiveTracingFunction: | ||
Type: AWS::Serverless::Function | ||
Properties: | ||
Handler: index.handler | ||
Runtime: nodejs14.x | ||
InlineCode: | | ||
exports.handler = async (event, context, callback) => { | ||
return { | ||
statusCode: 200, | ||
body: 'Success' | ||
} | ||
} | ||
MemorySize: 128 | ||
Policies: | ||
- AWSLambdaRole | ||
- AmazonS3ReadOnlyAccess | ||
Tracing: Active | ||
|
||
ActiveIntrinsicTracingFunction: | ||
Type: AWS::Serverless::Function | ||
Properties: | ||
Handler: index.handler | ||
Runtime: nodejs14.x | ||
InlineCode: | | ||
exports.handler = async (event, context, callback) => { | ||
return { | ||
statusCode: 200, | ||
body: 'Success' | ||
} | ||
} | ||
MemorySize: 128 | ||
Policies: | ||
- AWSLambdaRole | ||
- AmazonS3ReadOnlyAccess | ||
Tracing: !Ref TracingParamActive | ||
|
||
PassThroughTracingFunction: | ||
Type: AWS::Serverless::Function | ||
Properties: | ||
Handler: index.handler | ||
Runtime: nodejs14.x | ||
InlineCode: | | ||
exports.handler = async (event, context, callback) => { | ||
return { | ||
statusCode: 200, | ||
body: 'Success' | ||
} | ||
} | ||
MemorySize: 128 | ||
Policies: | ||
- AWSLambdaRole | ||
- AmazonS3ReadOnlyAccess | ||
Tracing: PassThrough | ||
|
||
PassThroughIntrinsicTracingFunction: | ||
Type: AWS::Serverless::Function | ||
Properties: | ||
Handler: index.handler | ||
Runtime: nodejs14.x | ||
MemorySize: 128 | ||
InlineCode: | | ||
exports.handler = async (event, context, callback) => { | ||
return { | ||
statusCode: 200, | ||
body: 'Success' | ||
} | ||
} | ||
Policies: | ||
- AWSLambdaRole | ||
- AmazonS3ReadOnlyAccess | ||
Tracing: | ||
Ref: TracingParamPassThrough |
252 changes: 252 additions & 0 deletions
252
tests/translator/output/aws-cn/function_with_tracing.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,252 @@ | ||
{ | ||
"Parameters": { | ||
"TracingParamActive": { | ||
"Default": "Active", | ||
"Type": "String" | ||
}, | ||
"TracingParamPassThrough": { | ||
"Default": "PassThrough", | ||
"Type": "String" | ||
} | ||
}, | ||
"Resources": { | ||
"ActiveIntrinsicTracingFunction": { | ||
"Properties": { | ||
"Code": { | ||
"ZipFile": "exports.handler = async (event, context, callback) => {\n return {\n statusCode: 200,\n body: 'Success'\n }\n }\n" | ||
}, | ||
"Handler": "index.handler", | ||
"MemorySize": 128, | ||
"Role": { | ||
"Fn::GetAtt": [ | ||
"ActiveIntrinsicTracingFunctionRole", | ||
"Arn" | ||
] | ||
}, | ||
"Runtime": "nodejs14.x", | ||
"Tags": [ | ||
{ | ||
"Key": "lambda:createdBy", | ||
"Value": "SAM" | ||
} | ||
], | ||
"TracingConfig": { | ||
"Mode": { | ||
"Ref": "TracingParamActive" | ||
} | ||
} | ||
}, | ||
"Type": "AWS::Lambda::Function" | ||
}, | ||
"ActiveIntrinsicTracingFunctionRole": { | ||
"Properties": { | ||
"AssumeRolePolicyDocument": { | ||
"Statement": [ | ||
{ | ||
"Action": [ | ||
"sts:AssumeRole" | ||
], | ||
"Effect": "Allow", | ||
"Principal": { | ||
"Service": [ | ||
"lambda.amazonaws.com" | ||
] | ||
} | ||
} | ||
], | ||
"Version": "2012-10-17" | ||
}, | ||
"ManagedPolicyArns": [ | ||
"arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", | ||
"arn:aws-cn:iam::aws:policy/AWSXRayDaemonWriteAccess", | ||
"arn:aws-cn:iam::aws:policy/service-role/AWSLambdaRole", | ||
"arn:aws-cn:iam::aws:policy/AmazonS3ReadOnlyAccess" | ||
], | ||
"Tags": [ | ||
{ | ||
"Key": "lambda:createdBy", | ||
"Value": "SAM" | ||
} | ||
] | ||
}, | ||
"Type": "AWS::IAM::Role" | ||
}, | ||
"ActiveTracingFunction": { | ||
"Properties": { | ||
"Code": { | ||
"ZipFile": "exports.handler = async (event, context, callback) => {\n return {\n statusCode: 200,\n body: 'Success'\n }\n }\n" | ||
}, | ||
"Handler": "index.handler", | ||
"MemorySize": 128, | ||
"Role": { | ||
"Fn::GetAtt": [ | ||
"ActiveTracingFunctionRole", | ||
"Arn" | ||
] | ||
}, | ||
"Runtime": "nodejs14.x", | ||
"Tags": [ | ||
{ | ||
"Key": "lambda:createdBy", | ||
"Value": "SAM" | ||
} | ||
], | ||
"TracingConfig": { | ||
"Mode": "Active" | ||
} | ||
}, | ||
"Type": "AWS::Lambda::Function" | ||
}, | ||
"ActiveTracingFunctionRole": { | ||
"Properties": { | ||
"AssumeRolePolicyDocument": { | ||
"Statement": [ | ||
{ | ||
"Action": [ | ||
"sts:AssumeRole" | ||
], | ||
"Effect": "Allow", | ||
"Principal": { | ||
"Service": [ | ||
"lambda.amazonaws.com" | ||
] | ||
} | ||
} | ||
], | ||
"Version": "2012-10-17" | ||
}, | ||
"ManagedPolicyArns": [ | ||
"arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", | ||
"arn:aws-cn:iam::aws:policy/AWSXRayDaemonWriteAccess", | ||
"arn:aws-cn:iam::aws:policy/service-role/AWSLambdaRole", | ||
"arn:aws-cn:iam::aws:policy/AmazonS3ReadOnlyAccess" | ||
], | ||
"Tags": [ | ||
{ | ||
"Key": "lambda:createdBy", | ||
"Value": "SAM" | ||
} | ||
] | ||
}, | ||
"Type": "AWS::IAM::Role" | ||
}, | ||
"PassThroughIntrinsicTracingFunction": { | ||
"Properties": { | ||
"Code": { | ||
"ZipFile": "exports.handler = async (event, context, callback) => {\n return {\n statusCode: 200,\n body: 'Success'\n }\n }\n" | ||
}, | ||
"Handler": "index.handler", | ||
"MemorySize": 128, | ||
"Role": { | ||
"Fn::GetAtt": [ | ||
"PassThroughIntrinsicTracingFunctionRole", | ||
"Arn" | ||
] | ||
}, | ||
"Runtime": "nodejs14.x", | ||
"Tags": [ | ||
{ | ||
"Key": "lambda:createdBy", | ||
"Value": "SAM" | ||
} | ||
], | ||
"TracingConfig": { | ||
"Mode": { | ||
"Ref": "TracingParamPassThrough" | ||
} | ||
} | ||
}, | ||
"Type": "AWS::Lambda::Function" | ||
}, | ||
"PassThroughIntrinsicTracingFunctionRole": { | ||
"Properties": { | ||
"AssumeRolePolicyDocument": { | ||
"Statement": [ | ||
{ | ||
"Action": [ | ||
"sts:AssumeRole" | ||
], | ||
"Effect": "Allow", | ||
"Principal": { | ||
"Service": [ | ||
"lambda.amazonaws.com" | ||
] | ||
} | ||
} | ||
], | ||
"Version": "2012-10-17" | ||
}, | ||
"ManagedPolicyArns": [ | ||
"arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", | ||
"arn:aws-cn:iam::aws:policy/service-role/AWSLambdaRole", | ||
"arn:aws-cn:iam::aws:policy/AmazonS3ReadOnlyAccess" | ||
], | ||
"Tags": [ | ||
{ | ||
"Key": "lambda:createdBy", | ||
"Value": "SAM" | ||
} | ||
] | ||
}, | ||
"Type": "AWS::IAM::Role" | ||
}, | ||
"PassThroughTracingFunction": { | ||
"Properties": { | ||
"Code": { | ||
"ZipFile": "exports.handler = async (event, context, callback) => {\n return {\n statusCode: 200,\n body: 'Success'\n }\n }\n" | ||
}, | ||
"Handler": "index.handler", | ||
"MemorySize": 128, | ||
"Role": { | ||
"Fn::GetAtt": [ | ||
"PassThroughTracingFunctionRole", | ||
"Arn" | ||
] | ||
}, | ||
"Runtime": "nodejs14.x", | ||
"Tags": [ | ||
{ | ||
"Key": "lambda:createdBy", | ||
"Value": "SAM" | ||
} | ||
], | ||
"TracingConfig": { | ||
"Mode": "PassThrough" | ||
} | ||
}, | ||
"Type": "AWS::Lambda::Function" | ||
}, | ||
"PassThroughTracingFunctionRole": { | ||
"Properties": { | ||
"AssumeRolePolicyDocument": { | ||
"Statement": [ | ||
{ | ||
"Action": [ | ||
"sts:AssumeRole" | ||
], | ||
"Effect": "Allow", | ||
"Principal": { | ||
"Service": [ | ||
"lambda.amazonaws.com" | ||
] | ||
} | ||
} | ||
], | ||
"Version": "2012-10-17" | ||
}, | ||
"ManagedPolicyArns": [ | ||
"arn:aws-cn:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole", | ||
"arn:aws-cn:iam::aws:policy/service-role/AWSLambdaRole", | ||
"arn:aws-cn:iam::aws:policy/AmazonS3ReadOnlyAccess" | ||
], | ||
"Tags": [ | ||
{ | ||
"Key": "lambda:createdBy", | ||
"Value": "SAM" | ||
} | ||
] | ||
}, | ||
"Type": "AWS::IAM::Role" | ||
} | ||
} | ||
} |
Oops, something went wrong.