Skip to content

Commit

Permalink
Merge branch 'main' into yuanhaoz/securityfix
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Jul 19, 2024
2 parents 2967aff + e3c0764 commit cf545ed
Show file tree
Hide file tree
Showing 13 changed files with 233 additions and 145 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/closed-issue-message.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@ name: Closed Issue Message
on:
issues:
types: [closed]
pull_request_target:
types: [closed]
jobs:
auto_comment:
permissions:
pull-requests: write
issues: write
runs-on: ubuntu-latest
steps:
Expand All @@ -13,7 +16,6 @@ jobs:
# These inputs are both required
repo-token: "${{ secrets.GITHUB_TOKEN }}"
message: |
### ⚠️COMMENT VISIBILITY WARNING⚠️
Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
{
"Ref": "AWS::Region"
},
":901920570463:layer:aws-otel-nodejs-arm64-ver-1-18-1:3"
":901920570463:layer:aws-otel-nodejs-arm64-ver-1-18-1:4"
]
]
}
Expand Down Expand Up @@ -176,7 +176,7 @@
{
"Ref": "AWS::Region"
},
":901920570463:layer:aws-otel-python-amd64-ver-1-24-0:1"
":901920570463:layer:aws-otel-python-amd64-ver-1-25-0:1"
]
]
}
Expand Down Expand Up @@ -273,7 +273,7 @@
{
"Ref": "AWS::Region"
},
":901920570463:layer:aws-otel-java-wrapper-amd64-ver-1-32-0:2"
":901920570463:layer:aws-otel-java-wrapper-amd64-ver-1-32-0:3"
]
]
}
Expand Down Expand Up @@ -370,7 +370,7 @@
{
"Ref": "AWS::Region"
},
":901920570463:layer:aws-otel-java-agent-amd64-ver-1-32-0:2"
":901920570463:layer:aws-otel-java-agent-amd64-ver-1-32-0:3"
]
]
}
Expand Down Expand Up @@ -467,7 +467,7 @@
{
"Ref": "AWS::Region"
},
":901920570463:layer:aws-otel-collector-amd64-ver-0-98-0:5"
":901920570463:layer:aws-otel-collector-amd64-ver-0-102-1:1"
]
]
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
{
"Ref": "AWS::Region"
},
":901920570463:layer:aws-otel-nodejs-amd64-ver-1-18-1:3"
":901920570463:layer:aws-otel-nodejs-amd64-ver-1-18-1:4"
]
]
}
Expand Down Expand Up @@ -176,7 +176,7 @@
{
"Ref": "AWS::Region"
},
":901920570463:layer:aws-otel-python-amd64-ver-1-24-0:1"
":901920570463:layer:aws-otel-python-amd64-ver-1-25-0:1"
]
]
}
Expand Down Expand Up @@ -273,7 +273,7 @@
{
"Ref": "AWS::Region"
},
":901920570463:layer:aws-otel-java-wrapper-amd64-ver-1-32-0:2"
":901920570463:layer:aws-otel-java-wrapper-amd64-ver-1-32-0:3"
]
]
}
Expand Down Expand Up @@ -370,7 +370,7 @@
{
"Ref": "AWS::Region"
},
":901920570463:layer:aws-otel-java-agent-amd64-ver-1-32-0:2"
":901920570463:layer:aws-otel-java-agent-amd64-ver-1-32-0:3"
]
]
}
Expand Down Expand Up @@ -467,7 +467,7 @@
{
"Ref": "AWS::Region"
},
":901920570463:layer:aws-otel-collector-amd64-ver-0-98-0:5"
":901920570463:layer:aws-otel-collector-amd64-ver-0-102-1:1"
]
]
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 12 additions & 2 deletions packages/aws-cdk-lib/aws-lambda/lib/adot-layers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,11 @@ export class AdotLambdaLayerJavaAutoInstrumentationVersion extends AdotLambdaLay
* The collection of versions of the ADOT Lambda Layer for Python SDK
*/
export class AdotLambdaLayerPythonSdkVersion extends AdotLambdaLayerVersion {
/**
* Version 1.25.0
*/
public static readonly V1_25_0 = new AdotLambdaLayerPythonSdkVersion('1.25.0');

/**
* Version 1.24.0
*/
Expand Down Expand Up @@ -348,7 +353,7 @@ export class AdotLambdaLayerPythonSdkVersion extends AdotLambdaLayerVersion {
* The latest layer version available in this CDK version. New versions could
* introduce incompatible changes. Make sure to test them before deploying to production.
*/
public static readonly LATEST = this.V1_24_0;
public static readonly LATEST = this.V1_25_0;

private constructor(protected readonly layerVersion: string) {
super(AdotLambdaLayerType.PYTHON_SDK, layerVersion);
Expand Down Expand Up @@ -399,6 +404,11 @@ export class AdotLambdaLayerJavaScriptSdkVersion extends AdotLambdaLayerVersion
* The collection of versions of the ADOT Lambda Layer for generic purpose
*/
export class AdotLambdaLayerGenericVersion extends AdotLambdaLayerVersion {
/**
* Version 0.102.1
*/
public static readonly V0_102_1 = new AdotLambdaLayerGenericVersion('0.102.1');

/**
* Version 0.98.0
*/
Expand Down Expand Up @@ -433,7 +443,7 @@ export class AdotLambdaLayerGenericVersion extends AdotLambdaLayerVersion {
* The latest layer version available in this CDK version. New versions could
* introduce incompatible changes. Make sure to test them before deploying to production.
*/
public static readonly LATEST = this.V0_98_0;
public static readonly LATEST = this.V0_102_1;

private constructor(protected readonly layerVersion: string) {
super(AdotLambdaLayerType.GENERIC, layerVersion);
Expand Down
12 changes: 6 additions & 6 deletions packages/aws-cdk-lib/aws-lambda/test/adot.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ describe('ADOT Lambda Layer', () => {
const layerArn = lambda.AdotLambdaLayerJavaSdkVersion.V1_32_0.layerArn(fn.stack, fn.architecture);

expect(layerArn).toEqual(
'arn:aws:lambda:us-west-2:901920570463:layer:aws-otel-java-wrapper-amd64-ver-1-32-0:2',
'arn:aws:lambda:us-west-2:901920570463:layer:aws-otel-java-wrapper-amd64-ver-1-32-0:3',
);
});

test('is added properly when using "LATEST" version', () => {
const layerArn = lambda.AdotLambdaLayerJavaSdkVersion.LATEST.layerArn(fn.stack, fn.architecture);

expect(layerArn).toEqual(
'arn:aws:lambda:us-west-2:901920570463:layer:aws-otel-java-wrapper-amd64-ver-1-32-0:2',
'arn:aws:lambda:us-west-2:901920570463:layer:aws-otel-java-wrapper-amd64-ver-1-32-0:3',
);
});
});
Expand All @@ -53,18 +53,18 @@ describe('ADOT Lambda Layer', () => {
});

test('is added properly when the region information is available at synthesis time', () => {
const layerArn = lambda.AdotLambdaLayerPythonSdkVersion.V1_24_0.layerArn(fn.stack, fn.architecture);
const layerArn = lambda.AdotLambdaLayerPythonSdkVersion.V1_25_0.layerArn(fn.stack, fn.architecture);

expect(layerArn).toEqual(
'arn:aws:lambda:us-west-2:901920570463:layer:aws-otel-python-amd64-ver-1-24-0:1',
'arn:aws:lambda:us-west-2:901920570463:layer:aws-otel-python-amd64-ver-1-25-0:1',
);
});

test('is added properly when using "LATEST" version', () => {
const layerArn = lambda.AdotLambdaLayerPythonSdkVersion.LATEST.layerArn(fn.stack, fn.architecture);

expect(layerArn).toEqual(
'arn:aws:lambda:us-west-2:901920570463:layer:aws-otel-python-amd64-ver-1-24-0:1',
'arn:aws:lambda:us-west-2:901920570463:layer:aws-otel-python-amd64-ver-1-25-0:1',
);
});
});
Expand Down Expand Up @@ -114,7 +114,7 @@ describe('ADOT Lambda Layer', () => {
{
Ref: 'AWS::Region',
},
':901920570463:layer:aws-otel-java-wrapper-arm64-ver-1-32-0:2',
':901920570463:layer:aws-otel-java-wrapper-arm64-ver-1-32-0:3',
],
],
},
Expand Down
8 changes: 4 additions & 4 deletions packages/aws-cdk-lib/aws-lambda/test/function.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3565,7 +3565,7 @@ describe('function', () => {

// THEN
Template.fromStack(stack).hasResourceProperties('AWS::Lambda::Function', {
Layers: ['arn:aws:lambda:us-west-2:901920570463:layer:aws-otel-java-wrapper-amd64-ver-1-32-0:2'],
Layers: ['arn:aws:lambda:us-west-2:901920570463:layer:aws-otel-java-wrapper-amd64-ver-1-32-0:3'],
Environment: {
Variables: {
AWS_LAMBDA_EXEC_WRAPPER: '/opt/otel-handler',
Expand All @@ -3587,14 +3587,14 @@ describe('function', () => {
handler: 'index.handler',
runtime: lambda.Runtime.PYTHON_3_9,
adotInstrumentation: {
layerVersion: lambda.AdotLayerVersion.fromPythonSdkLayerVersion(lambda.AdotLambdaLayerPythonSdkVersion.V1_24_0),
layerVersion: lambda.AdotLayerVersion.fromPythonSdkLayerVersion(lambda.AdotLambdaLayerPythonSdkVersion.V1_25_0),
execWrapper: lambda.AdotLambdaExecWrapper.INSTRUMENT_HANDLER,
},
});

// THEN
Template.fromStack(stack).hasResourceProperties('AWS::Lambda::Function', {
Layers: ['arn:aws:lambda:us-west-2:901920570463:layer:aws-otel-python-amd64-ver-1-24-0:1'],
Layers: ['arn:aws:lambda:us-west-2:901920570463:layer:aws-otel-python-amd64-ver-1-25-0:1'],
Environment: {
Variables: {
AWS_LAMBDA_EXEC_WRAPPER: '/opt/otel-instrument',
Expand All @@ -3611,7 +3611,7 @@ describe('function', () => {
handler: 'index.handler',
runtime: lambda.Runtime.PYTHON_3_10,
adotInstrumentation: {
layerVersion: lambda.AdotLayerVersion.fromPythonSdkLayerVersion(lambda.AdotLambdaLayerPythonSdkVersion.V1_24_0),
layerVersion: lambda.AdotLayerVersion.fromPythonSdkLayerVersion(lambda.AdotLambdaLayerPythonSdkVersion.V1_25_0),
execWrapper: lambda.AdotLambdaExecWrapper.REGULAR_HANDLER,
},
})).toThrow(/Python Adot Lambda layer requires AdotLambdaExecWrapper.INSTRUMENT_HANDLER/);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,8 @@ export abstract class CustomResourceProviderBase extends Construct {

this._codeHash = staging.assetHash;

fs.rmSync(stagingDirectory, { recursive: true, force: true });

return {
code: {
S3Bucket: asset.bucketName,
Expand Down
Loading

0 comments on commit cf545ed

Please sign in to comment.