Skip to content

Commit

Permalink
Merge branch 'main' into fix/nlb/listener
Browse files Browse the repository at this point in the history
  • Loading branch information
colifran authored Jun 19, 2023
2 parents 263c5a2 + 133c9b5 commit 2a5a174
Show file tree
Hide file tree
Showing 37 changed files with 5,368 additions and 194 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/issue-label-assign.yml
Original file line number Diff line number Diff line change
Expand Up @@ -282,5 +282,5 @@ env:
{"area":"@aws-cdk/triggers","keywords":["trigger","triggers"],"labels":["@aws-cdk/triggers"]},
{"area":"@aws-cdk/integ-tests","keywords":["integ-tests", "integ"],"labels":["@aws-cdk/integ-tests"]},
{"area":"@aws-cdk/integ-runner","keywords":["integ-runner"],"labels":["@aws-cdk/integ-runner"]},
{"area":"@aws-cdk/app-staging-synthesizer-alpha", "keywords":["app-staging-synthesizer", "app-staging-synthesizer-alpha"],"labels:["@aws-cdk/app-staging-synthesizer-alpha"]"}
{"area":"@aws-cdk/app-staging-synthesizer-alpha", "keywords":["app-staging-synthesizer", "app-staging-synthesizer-alpha"],"labels":["@aws-cdk/app-staging-synthesizer-alpha"]}
]
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -1095,7 +1095,7 @@ automatically, and we have to use a feature flag:
Adding a new flag looks as follows:

1. Define a new const under
[cx-api/lib/features.ts](https://github.com/aws/aws-cdk/blob/main/packages/%40aws-cdk/cx-api/lib/features.ts)
[cx-api/lib/features.ts](https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/cx-api/lib/features.ts)
with the name of the context key that enables this new feature (for
example, `ENABLE_STACK_NAME_DUPLICATES`). The context key should be in the
form `module.Type:feature` (e.g. `@aws-cdk/core:enableStackNameDuplicates`).
Expand All @@ -1106,12 +1106,12 @@ Adding a new flag looks as follows:
2. Use `FeatureFlags.of(construct).isEnabled(cxapi.ENABLE_XXX)` to check if this feature is enabled
in your code. If it is not defined, revert to the legacy behavior.
3. Add your feature flag to the `FLAGS` map in
[cx-api/lib/features.ts](https://github.com/aws/aws-cdk/blob/main/packages/%40aws-cdk/cx-api/lib/features.ts). In
[cx-api/lib/features.ts](https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/cx-api/lib/features.ts). In
your description, be sure to cover the following:
- Consciously pick the type of feature flag. Can the flag be removed in a future major version, or not?
- Motivate why the feature flag exists. What is the change to existing infrastructure and why is it not safe?
- In case of a "default change flag", describe what the user needs to do to restore the old behavior.
4. Add an entry for your feature flag in the [README](https://github.com/aws/aws-cdk/blob/main/packages/%40aws-cdk/cx-api/README.md) file.
4. Add an entry for your feature flag in the [README](https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/cx-api/README.md) file.
5. In your tests, ensure that you test your feature with and without the feature flag enabled. You can do this by passing the feature flag to the `context` property when instantiating an `App`.
```ts
const myFeatureFlag = { [cxapi.MY_FEATURE_FLAG]: true };
Expand All @@ -1124,7 +1124,7 @@ Adding a new flag looks as follows:

`fix(core): impossible to use the same physical stack name for two stacks (under feature flag)`

[jest helper methods]: https://github.com/aws/aws-cdk/blob/main/tools/@aws-cdk/cdk-build-tools/lib/feature-flag.ts
[jest helper methods]: https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/core/lib/feature-flags.ts

## Versioning and Release

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
}
}
},
"64fb6d6ac3e1f7cda4cb6336b78f1be8f0e1f6c6323b232c8e04430a803085a2": {
"750190a0dbe80dfcab9c761fced7db8ca431c751df10b9c2aa9e73d18a6f1414": {
"source": {
"path": "Stack1.template.json",
"packaging": "file"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "64fb6d6ac3e1f7cda4cb6336b78f1be8f0e1f6c6323b232c8e04430a803085a2.json",
"objectKey": "750190a0dbe80dfcab9c761fced7db8ca431c751df10b9c2aa9e73d18a6f1414.json",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,11 @@
],
"Environment": {
"Variables": {
"PARAMETERS_AND_SECRETS_EXTENSION_CACHE_ENABLED": "true",
"PARAMETERS_AND_SECRETS_EXTENSION_CACHE_SIZE": "100",
"PARAMETERS_AND_SECRETS_EXTENSION_HTTP_PORT": "2773",
"PARAMETERS_AND_SECRETS_EXTENSION_LOG_LEVEL": "info",
"PARAMETERS_AND_SECRETS_EXTENSION_MAX_CONNECTIONS": "3",
"PARAMETERS_SECRETS_EXTENSION_CACHE_ENABLED": "true",
"PARAMETERS_SECRETS_EXTENSION_CACHE_SIZE": "100",
"PARAMETERS_SECRETS_EXTENSION_HTTP_PORT": "8080",
"PARAMETERS_SECRETS_EXTENSION_LOG_LEVEL": "debug",
"PARAMETERS_SECRETS_EXTENSION_MAX_CONNECTIONS": "5",
"SECRETS_MANAGER_TIMEOUT_MILLIS": "0",
"SECRETS_MANAGER_TTL": "100",
"SSM_PARAMETER_STORE_TIMEOUT_MILLIS": "0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
}
}
},
"6e1695d4618774814bd2b919c4dfbc4e9eee44fc0caea11b6c60b543848088a8": {
"fc5442e0fcfb1c7fdef66ec049ee0905d02bb13f4fc9fbeb317bec60ec5fef09": {
"source": {
"path": "Stack2.template.json",
"packaging": "file"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "6e1695d4618774814bd2b919c4dfbc4e9eee44fc0caea11b6c60b543848088a8.json",
"objectKey": "fc5442e0fcfb1c7fdef66ec049ee0905d02bb13f4fc9fbeb317bec60ec5fef09.json",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,11 @@
],
"Environment": {
"Variables": {
"PARAMETERS_AND_SECRETS_EXTENSION_CACHE_ENABLED": "true",
"PARAMETERS_AND_SECRETS_EXTENSION_CACHE_SIZE": "100",
"PARAMETERS_AND_SECRETS_EXTENSION_HTTP_PORT": "2773",
"PARAMETERS_AND_SECRETS_EXTENSION_LOG_LEVEL": "info",
"PARAMETERS_AND_SECRETS_EXTENSION_MAX_CONNECTIONS": "3",
"PARAMETERS_SECRETS_EXTENSION_CACHE_ENABLED": "true",
"PARAMETERS_SECRETS_EXTENSION_CACHE_SIZE": "100",
"PARAMETERS_SECRETS_EXTENSION_HTTP_PORT": "8080",
"PARAMETERS_SECRETS_EXTENSION_LOG_LEVEL": "debug",
"PARAMETERS_SECRETS_EXTENSION_MAX_CONNECTIONS": "5",
"SECRETS_MANAGER_TIMEOUT_MILLIS": "0",
"SECRETS_MANAGER_TTL": "100",
"SSM_PARAMETER_STORE_TIMEOUT_MILLIS": "0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"validateOnSynth": false,
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}",
"cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}",
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/64fb6d6ac3e1f7cda4cb6336b78f1be8f0e1f6c6323b232c8e04430a803085a2.json",
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/750190a0dbe80dfcab9c761fced7db8ca431c751df10b9c2aa9e73d18a6f1414.json",
"requiresBootstrapStackVersion": 6,
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version",
"additionalDependencies": [
Expand Down Expand Up @@ -100,7 +100,7 @@
"validateOnSynth": false,
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}",
"cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}",
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/6e1695d4618774814bd2b919c4dfbc4e9eee44fc0caea11b6c60b543848088a8.json",
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/fc5442e0fcfb1c7fdef66ec049ee0905d02bb13f4fc9fbeb317bec60ec5fef09.json",
"requiresBootstrapStackVersion": 6,
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version",
"additionalDependencies": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,11 +244,11 @@
],
"environment": {
"variables": {
"PARAMETERS_AND_SECRETS_EXTENSION_CACHE_ENABLED": "true",
"PARAMETERS_AND_SECRETS_EXTENSION_CACHE_SIZE": "100",
"PARAMETERS_AND_SECRETS_EXTENSION_HTTP_PORT": "2773",
"PARAMETERS_AND_SECRETS_EXTENSION_LOG_LEVEL": "info",
"PARAMETERS_AND_SECRETS_EXTENSION_MAX_CONNECTIONS": "3",
"PARAMETERS_SECRETS_EXTENSION_CACHE_ENABLED": "true",
"PARAMETERS_SECRETS_EXTENSION_CACHE_SIZE": "100",
"PARAMETERS_SECRETS_EXTENSION_HTTP_PORT": "8080",
"PARAMETERS_SECRETS_EXTENSION_LOG_LEVEL": "debug",
"PARAMETERS_SECRETS_EXTENSION_MAX_CONNECTIONS": "5",
"SECRETS_MANAGER_TIMEOUT_MILLIS": "0",
"SECRETS_MANAGER_TTL": "100",
"SSM_PARAMETER_STORE_TIMEOUT_MILLIS": "0",
Expand Down Expand Up @@ -559,11 +559,11 @@
],
"environment": {
"variables": {
"PARAMETERS_AND_SECRETS_EXTENSION_CACHE_ENABLED": "true",
"PARAMETERS_AND_SECRETS_EXTENSION_CACHE_SIZE": "100",
"PARAMETERS_AND_SECRETS_EXTENSION_HTTP_PORT": "2773",
"PARAMETERS_AND_SECRETS_EXTENSION_LOG_LEVEL": "info",
"PARAMETERS_AND_SECRETS_EXTENSION_MAX_CONNECTIONS": "3",
"PARAMETERS_SECRETS_EXTENSION_CACHE_ENABLED": "true",
"PARAMETERS_SECRETS_EXTENSION_CACHE_SIZE": "100",
"PARAMETERS_SECRETS_EXTENSION_HTTP_PORT": "8080",
"PARAMETERS_SECRETS_EXTENSION_LOG_LEVEL": "debug",
"PARAMETERS_SECRETS_EXTENSION_MAX_CONNECTIONS": "5",
"SECRETS_MANAGER_TIMEOUT_MILLIS": "0",
"SECRETS_MANAGER_TTL": "100",
"SSM_PARAMETER_STORE_TIMEOUT_MILLIS": "0",
Expand Down Expand Up @@ -647,7 +647,7 @@
"path": "IntegTest/DefaultTest/Default",
"constructInfo": {
"fqn": "constructs.Construct",
"version": "10.2.26"
"version": "10.2.52"
}
},
"DeployAssert": {
Expand Down Expand Up @@ -693,7 +693,7 @@
"path": "Tree",
"constructInfo": {
"fqn": "constructs.Construct",
"version": "10.2.26"
"version": "10.2.52"
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
Code,
ParamsAndSecretsLayerVersion,
ParamsAndSecretsVersions,
ParamsAndSecretsLogLevel,
} from 'aws-cdk-lib/aws-lambda';

const app = new cdk.App();
Expand All @@ -32,6 +33,10 @@ class StackUnderTest extends Stack {

const paramsAndSecrets = ParamsAndSecretsLayerVersion.fromVersion(ParamsAndSecretsVersions.V1_0_103, {
cacheSize: 100,
cacheEnabled: true,
httpPort: 8080,
logLevel: ParamsAndSecretsLogLevel.DEBUG,
maxConnections: 5,
secretsManagerTtl: cdk.Duration.seconds(100),
parameterStoreTtl: cdk.Duration.seconds(100),
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ def handler(event, context):
headers = {'X-Aws-Parameters-Secrets-Token': session_token}

# request to parameter store
parameter_url = 'http://localhost:2773/systemsmanager/parameters/get?name=email_url'
parameter_url = 'http://localhost:8080/systemsmanager/parameters/get?name=email_url'
response = requests.get(parameter_url, headers=headers)
print(f'response status code from HTTP for parameters request was {response.status_code}')
print(f'response json is {response.json()}')

# request to secrets manager
secrets_url = 'https://localhost:2773/secretsmanager/get?secretId=MySecret'
secrets_url = 'https://localhost:8080/secretsmanager/get?secretId=MySecret'
response = requests.get(secrets_url, headers=headers)
print(f'response status code from HTTP for secrets request was {response.status_code}')
print(f'response json is {response.json()}')
Binary file not shown.
Loading

0 comments on commit 2a5a174

Please sign in to comment.