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(cloud9): support imageid when creating cloud9 environment #21194

Merged
merged 11 commits into from
Jul 19, 2022

Conversation

sean-beath
Copy link
Contributor

@sean-beath sean-beath commented Jul 18, 2022

Allows users to include the imageId parameter to specify which EC2 AMI to be used when creating the environment.

closes: #20908.

Shout out to @jumic for beginning the fix.

Unable to run yarn integ due to breaking change.

BREAKING CHANGE: The imageId parameter is now required and deployments will fail without it


All Submissions:

Adding new Unconventional Dependencies:

  • This PR adds new unconventional dependencies following the process described here

New Features

  • Have you added the new feature to an integration test?
    • Did you use yarn integ to deploy the infrastructure and generate the snapshot (i.e. yarn integ without --dry-run)?

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

BREAKING CHANGE: imageId is now a required parameter for Cloud9 environments. Any stack without this parameter will fail.
BREAKING CHANGE: imageId is now a required parameter for Cloud9 environments. Any stack without this parameter will fail.
@gitpod-io
Copy link

gitpod-io bot commented Jul 18, 2022

@aws-cdk-automation aws-cdk-automation requested a review from a team July 18, 2022 07:24
@github-actions github-actions bot added the p2 label Jul 18, 2022
@TheRealAmazonKendra TheRealAmazonKendra changed the title feat(aws-cloud9): support imageid when creating cloud9 environment feat(cloud9): support imageid when creating cloud9 environment Jul 19, 2022
Copy link
Contributor

@TheRealAmazonKendra TheRealAmazonKendra left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution! This is great work. I just have a few comments below. Additionally, please update the other integration tests to expect AL2 instead of AL1. That's why the build is currently failing.

@@ -42,13 +42,14 @@ EC2 Environments are defined with `Ec2Environment`. To create an EC2 environment
```ts
// create a cloud9 ec2 environment in a new VPC
const vpc = new ec2.Vpc(this, 'VPC', { maxAzs: 3});
new cloud9.Ec2Environment(this, 'Cloud9Env', { vpc });
new cloud9.Ec2Environment(this, 'Cloud9Env', { vpc }, imageId: cloud9.ImageId.AMAZON_LINUX_2,);
Copy link
Contributor

Choose a reason for hiding this comment

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

If imageId is a prop, it would need to be inside the curly brackets, not outside.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

/**
* Create using Amazon Linux 1
*/
AMAZON_LINUX_1 = 'amazonlinux-1-x86_64',
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 in maintenance support, which means that new instances shouldn't be created. Let's not include it in the options.

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've removed AMAZON_LINUX_1

@@ -29,7 +29,7 @@ export interface IEc2Environment extends cdk.IResource {
*/
export enum ConnectionType {
/**
* Conect through SSH
* Connect through SSH
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for catching this!

/**
* The image ID used for creating an Amazon EC2 environment.
*
* Valid values are: AMAZON_LINUX, AMAZON_LINUX_2, and UBUNTU_18_04
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's remove AL1

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@mergify mergify bot dismissed TheRealAmazonKendra’s stale review July 19, 2022 01:32

Pull request has been modified.

@sean-beath
Copy link
Contributor Author

Thanks for your review @TheRealAmazonKendra
I've updated the existing snapshots to expect AL2 and they are now passing yarn integ.
The new integ test is failing but I don't know how to make it work! If you can provide some guidance on what I'm missing, I'll make the change.

@TheRealAmazonKendra
Copy link
Contributor

Ah, luckily this is a simple issue, though it doesn't look like we have it documented very well. You just need to add "@aws-cdk/integ-tests": "0.0.0", as a devDependency in package.json.

@sean-beath
Copy link
Contributor Author

Thanks @TheRealAmazonKendra - I have added in that line and was able to successfully run the yarn integ on my end. Looks like the CodeBuild step is still failing though!

@TheRealAmazonKendra
Copy link
Contributor

@Mergifyio update

@mergify
Copy link
Contributor

mergify bot commented Jul 19, 2022

update

✅ Branch has been successfully updated

@TheRealAmazonKendra
Copy link
Contributor

Thanks @TheRealAmazonKendra - I have added in that line and was able to successfully run the yarn integ on my end. Looks like the CodeBuild step is still failing though!

Ugh, this again. This is a bug we had that got fixed this morning. The update I just did should fix it. It will rebase it main with the fix present.

Copy link
Contributor

@TheRealAmazonKendra TheRealAmazonKendra left a comment

Choose a reason for hiding this comment

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

Just one more tiny change, please. Besides this, as long as the build passes, this is good to go!

/**
* The image ID used for creating an Amazon EC2 environment.
*
* Valid values are: AMAZON_LINUX_2, and UBUNTU_18_04
Copy link
Contributor

@TheRealAmazonKendra TheRealAmazonKendra Jul 19, 2022

Choose a reason for hiding this comment

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

Let's remove this line (just 114). They're already defined in the enum and this will just provide additional overhead to update in the future.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks - have pushed the change

@mergify mergify bot dismissed TheRealAmazonKendra’s stale review July 19, 2022 06:46

Pull request has been modified.

@TheRealAmazonKendra
Copy link
Contributor

I made a small change to the README because I'm kind of guessing about what caused the failure this time. Seeing if that works.

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: c80c735
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

Copy link
Contributor

@TheRealAmazonKendra TheRealAmazonKendra left a comment

Choose a reason for hiding this comment

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

Success! Thank you for all your hard work on this!

@mergify
Copy link
Contributor

mergify bot commented Jul 19, 2022

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify mergify bot merged commit dcf3eb3 into aws:main Jul 19, 2022
comcalvi pushed a commit to comcalvi/aws-cdk that referenced this pull request Jul 25, 2022
…1194)

Allows users to include the imageId parameter to specify which EC2 AMI to be used when creating the environment.

closes: aws#20908.

Shout out to @jumic for beginning the fix.

Unable to run yarn integ due to breaking change.

BREAKING CHANGE: The imageId parameter is now required and deployments will fail without it

----

### All Submissions:

* [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md)

### Adding new Unconventional Dependencies:

* [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies)

### New Features

* [x] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)?
	* [x] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)?

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@sean-beath sean-beath deleted the feat/cloud9_imageId branch August 24, 2022 02:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

aws_cloud9_alpha: Give user ability to specify image ID, and make default to use recommended Amazon Linux 2
3 participants