Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(appconfig): L2 constructs #26467

Closed
wants to merge 17 commits into from
Closed

feat(appconfig): L2 constructs #26467

wants to merge 17 commits into from

Conversation

chenjane-dev
Copy link
Contributor

@chenjane-dev chenjane-dev commented Jul 21, 2023

Completes RCF #499


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@github-actions github-actions bot added the beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK label Jul 21, 2023
@aws-cdk-automation aws-cdk-automation requested a review from a team July 21, 2023 16:16
@github-actions github-actions bot added the p2 label Jul 21, 2023
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.

A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed add Clarification Request to a comment.

@chenjane-dev chenjane-dev changed the title Publish AppConfig L2 Constructs to Alpha Library feat(aws-appconfig): Publish AppConfig L2 Constructs to Alpha Library Jul 21, 2023
@otaviomacedo otaviomacedo self-assigned this Jul 31, 2023
});
```

A hosted configuration with type:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good place to educate users on what a type is. Same thing for validators and deployment strategy in the next two examples.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the README

packages/@aws-cdk/aws-appconfig-alpha/README.md Outdated Show resolved Hide resolved
packages/@aws-cdk/aws-appconfig-alpha/lib/configuration.ts Outdated Show resolved Hide resolved
/**
* Defines the deployment strategy ID's of AWS AppConfig predefined strategies.
*/
export enum PredefinedDeploymentStrategyId {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to keep this enum private? It seems like an implementation detail that should not be exposed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kept this enum here, in case customers wanted to directly import these existing and AppConfig authored deployment strategies, instead of creating new ones through RolloutStrategy.ALL_AT_ONCE, etc. Not super necessary but it might add some flexibility for customers who want to directly use the existing authored deployment strategies, rather than creating new ones.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand. What would they do with this enum other than create a RolloutStrategy?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They could import it directly

DeploymentStrategy.fromDeploymentStrategyId(this, 'MyImportedDeploymentStrategy', PredefinedDeploymentStratgeyId.ALL_AT_ONCE);

which imports the existing AppConfig authored deployment strategies.

Opposed to

new DeploymentStrategy(this, 'MyDeploymentStrategy', {
  rolloutStrategy: RolloutStrategy.ALL_AT_ONCE
});

which creates a new ALL_AT_ONCE deployment strategy (instead of using the existing AppConfig one)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. Thanks.

resourceName: this.applicationId,
});

this.extensible = new ExtensibleBase(scope, this.applicationArn);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sure there is a good reason to use composition instead of inheritance here, even if it creates a lot of duplication. You should document it somewhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where do you recommend documenting this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It depends on the reason, I guess. Is it because the constructs already extend cdk.Resource? If so, you could explain in the docstring of ExtensibleBase that it's supposed to be used with resources, but there is no way to inherit from two classes (at least within the jsii constraints).

Conversely, have you looked into making ExtensibleBase an abstract class that extends cdk.Resource?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will add that docstring. I don't think extending a cdk.Resource will suffice because IConfiguration is a Construct type and will have to inherit the ExtensibleBase still

packages/@aws-cdk/aws-appconfig-alpha/lib/configuration.ts Outdated Show resolved Hide resolved
@otaviomacedo otaviomacedo changed the title feat(aws-appconfig): Publish AppConfig L2 Constructs to Alpha Library feat(appconfig): L2 constructs Aug 1, 2023
@aws-cdk-automation aws-cdk-automation dismissed their stale review August 1, 2023 14:16

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

@mergify mergify bot dismissed otaviomacedo’s stale review August 1, 2023 19:32

Pull request has been modified.

wong-a and others added 16 commits August 4, 2023 09:56
…ine (#26443)

Expose `stateMachineRevisionId` as a readonly property to StateMachine whose value is a reference to the `StateMachineRevisionId` attribute of the underlying CloudFormation resource.

Closes #26440

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
…26455)

Makes it less confusing

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
…or of trigger failures (#26450)

TriggerCustomResourceProvider takes only the status code of Invoke API call into account.
https://github.com/aws/aws-cdk/blob/7a6f953fe5a4d7e0ba5833f06596b132c95e0709/packages/aws-cdk-lib/triggers/lib/lambda/index.ts#L69-L73

If invocationType is `EVENT`, Lambda function is invoked asynchronously. In that case, if Lambda function is invoked successfully, the trigger will success regardless of the result for the function execution. I add this consideration into README.

Closes #26341

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Co-authored-by: Kaizen Conroy <36202692+kaizencc@users.noreply.github.com>
Add missing Aurora Engine Version 3_02_3. 
See Aurora docs at https://docs.aws.amazon.com/AmazonRDS/latest/AuroraMySQLReleaseNotes/AuroraMySQL.Updates.3023.html

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Policy names with slashes (`/`) are not allowed when bootstrapping.

For example:
```
cdk bootstrap --custom-permissions-boundary aaa/bbb
```
Would fail:
```
Error: The permissions boundary name aaa/bbb does not match the IAM conventions.
```

This fix allows to specify paths in the policy name.

Closes #26320.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
…26297)

Reported issue with `diff` is that it treats the fail return status for cases when there are actual diffs, making it hard to know what happened with pipeline automations.

The proposed solution adds a logging statement with a similar format that is used for deploy (but here the total time is reported) specifying how many stacks have differences, as presented below. As a result, it will be possible to check in pipelines for this logging statement to correctly detect situation when there are no actual changes, when there are changes, and when there are failures, since on failures this statement will not be present:

Case of no changes:
✨  Number of stacks with differences: 0

Case of changes in 5 stacks:
✨  Number of stacks with differences: 5

Closes #10417.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
…or (#26465)

Closes #26415 

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
…26466)

Ran into an issue where the construct trace was incorrect in larger projects, specifically where there are constructs that contain multiple constructs.

To get the construct trace tree we first construct a new tree that only contains the path to the terminal construct (the one with the trace). We drop all the other constructs in the tree that don't relate. For example, if we had a tree like:

```
->App
-->MyStage
--->MyStack1
---->MyConstruct
----->Resource
--->MyStack2
---->MyConstruct
----->Resource
--->MyStack3
---->MyConstruct
----->Resource
```

And we want to get a new tree for
`/App/MyStage/MyStack2/MyConstruct/Resource` it should look like this:

```
->App
-->MyStage
--->MyStack2
---->MyConstruct
----->Resource
```

We weren't correctly generating the new tree correctly and would always end up with the tree being the first item in the list.

I've updated one of the tests, and also tested this on a more complex application.


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
…refix (#26324)

Optionally specify a prefix for the staging stack name, which will be baked into the stackId and stackName. The default prefix is `StagingStack`. 

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
… partitions (#26458)

Fixes #26456. 

Renames the isolated partitions to their correct names. 

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Implementing `IGrantable` for cases when it's needed to grant permissions to a `Service` instance.

For example:
```
declare const bucket: IBucket;

const service = new apprunner.Service(this, 'Service', {
    source: apprunner.Source.fromEcrPublic({
        imageConfiguration: { port: 8000 },
        imageIdentifier: 'public.ecr.aws/aws-containers/hello-app-runner:latest',
    }),
});

bucket.grantRead(service);
```

Closes #26089.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
… allowed to be specified as subscription and dead-letter queue (#26110)

To send message to SQS queues encrypted by KMS from SNS, we need to grant SNS service-principal access to the key by key policy. From this reason, we need to use customer managed key because we can't edit key policy for AWS managed key. However, CDK makes it easy to create such a non-functional subscription.

To prevent CDK from making such a subscription, I added the validation which throw an error when SQS queue encrypted by AWS managed KMS key is specified as subscription or dead-letter queue.

Closes #19796

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Fix issue with order of `-f` flag and file path in `rm` command for `pnpm` esbuild bundling step to remove `node_modules/.modules.yaml` from output dir. This is continuing to cause bundling step to fail for `pnpm` >= 8.4.0 with no external `node_modules` specified per issue #26478.

Solved by moving the `-f` flag before file path in the `rm` command and updating relevant unit test. Please note that I haven't adjusted the `del` command for windows env as not sure if same issue occurs in that env.

Exemption Request: No changes to integration test output of `aws-lambda-nodejs/test/integ.dependencies-pnpm.js` and don't feel this warrants a separate integration test.

Closes #26478.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.

A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed add Clarification Request to a comment.

@aws-cdk-automation aws-cdk-automation added the pr/needs-cli-test-run This PR needs CLI tests run against it. label Aug 4, 2023
@aws-cdk-automation
Copy link
Collaborator

The pull request linter fails with the following errors:

❌ CLI code has changed. A maintainer must run the code through the testing pipeline (git fetch origin pull/26467/head && git push -f origin FETCH_HEAD:test-main-pipeline), then add the 'pr-linter/cli-integ-tested' label when the pipeline succeeds.

PRs must pass status checks before we can provide a meaningful review.

If you would like to request an exemption from the status checks or clarification on feedback, please leave a comment on this PR containing Exemption Request and/or Clarification Request.

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 744841f
  • Result: FAILED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@aws-cdk-automation
Copy link
Collaborator

This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.

6 similar comments
@aws-cdk-automation
Copy link
Collaborator

This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.

@aws-cdk-automation
Copy link
Collaborator

This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.

@aws-cdk-automation
Copy link
Collaborator

This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.

@aws-cdk-automation
Copy link
Collaborator

This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.

@aws-cdk-automation
Copy link
Collaborator

This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.

@aws-cdk-automation
Copy link
Collaborator

This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state.

@amine-mf
Copy link
Contributor

amine-mf commented Sep 11, 2023

@chenjane-dev, @otaviomacedo Any plans to reopen this?

@chenjane-dev
Copy link
Contributor Author

Hi @amine-mf, this has been merged in a separate PR #26639

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK p2 pr/needs-cli-test-run This PR needs CLI tests run against it.
Projects
None yet
Development

Successfully merging this pull request may close these issues.