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(ec2): add nitro enclave and hibernation settings to the Instance Construct #30228

Merged
merged 27 commits into from
Jun 14, 2024

Conversation

mazyu36
Copy link
Contributor

@mazyu36 mazyu36 commented May 16, 2024

Issue # (if applicable)

N/A

Reason for this change

MIssing property in the L2 Construct

Description of changes

Add nitroEnclaveEnabled and hibernationConfigured property.

Description of how you validated changes

Added unit tests and integ tests.

Checklist


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

@aws-cdk-automation aws-cdk-automation requested a review from a team May 16, 2024 04:30
@github-actions github-actions bot added p2 repeat-contributor [Pilot] contributed between 3-5 PRs to the CDK labels May 16, 2024
@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label May 16, 2024
Copy link
Contributor

@go-to-k go-to-k left a comment

Choose a reason for hiding this comment

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

Thanks for the PR. I made some comments!

packages/aws-cdk-lib/aws-ec2/README.md Show resolved Hide resolved
packages/aws-cdk-lib/aws-ec2/lib/instance.ts Outdated Show resolved Hide resolved
packages/aws-cdk-lib/aws-ec2/lib/instance.ts Outdated Show resolved Hide resolved
packages/aws-cdk-lib/aws-ec2/lib/instance.ts Outdated Show resolved Hide resolved
packages/aws-cdk-lib/aws-ec2/lib/instance.ts Outdated Show resolved Hide resolved
*
* @default false
*/
readonly hibernationConfigured?: boolean;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we change to hibernationEnabled to match enclaveEnabled? (HibernationOptionsProperty in L1 has the configured, but ...)

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 changed the property name.

packages/aws-cdk-lib/aws-ec2/lib/instance.ts Show resolved Hide resolved
[true, true],
[false, false],
])('given nitroEnclaveEnabled %p', (given: boolean, expected: boolean) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

it needs to change the sentence If we change the parameter name.

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 to match the parameter name.

[true, true],
[false, false],
])('given hibernationConfigured %p', (given: boolean, expected: boolean) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as above.

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 to match the parameter name.

});

test('throw if AWS Nitro Enclaves and hibernation are enabled', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be good to use parameter names in the sentence.

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 changed the sentence to match parameter names.

mazyu36 and others added 11 commits May 23, 2024 20:45
Co-authored-by: k.goto (Kenta Goto) <24818752+go-to-k@users.noreply.github.com>
Co-authored-by: k.goto (Kenta Goto) <24818752+go-to-k@users.noreply.github.com>
Co-authored-by: k.goto (Kenta Goto) <24818752+go-to-k@users.noreply.github.com>
Co-authored-by: k.goto (Kenta Goto) <24818752+go-to-k@users.noreply.github.com>
Co-authored-by: k.goto (Kenta Goto) <24818752+go-to-k@users.noreply.github.com>
Co-authored-by: k.goto (Kenta Goto) <24818752+go-to-k@users.noreply.github.com>
Co-authored-by: k.goto (Kenta Goto) <24818752+go-to-k@users.noreply.github.com>
Co-authored-by: k.goto (Kenta Goto) <24818752+go-to-k@users.noreply.github.com>
Co-authored-by: k.goto (Kenta Goto) <24818752+go-to-k@users.noreply.github.com>
@aws-cdk-automation aws-cdk-automation removed the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label May 23, 2024
@mazyu36
Copy link
Contributor Author

mazyu36 commented May 23, 2024

@go-to-k
Thank you for your review!
I've addressed all your comments.

Copy link
Contributor

@go-to-k go-to-k left a comment

Choose a reason for hiding this comment

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

Please check the last comment (That is very very minor)!

packages/aws-cdk-lib/aws-ec2/README.md Show resolved Hide resolved
Co-authored-by: k.goto (Kenta Goto) <24818752+go-to-k@users.noreply.github.com>
Copy link
Contributor

@go-to-k go-to-k left a comment

Choose a reason for hiding this comment

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

Thanks!

@aws-cdk-automation aws-cdk-automation added the pr/needs-maintainer-review This PR needs a review from a Core Team Member label May 23, 2024
@shikha372 shikha372 self-assigned this May 24, 2024
@mazyu36
Copy link
Contributor Author

mazyu36 commented Jun 1, 2024

@shikha372
Thank you for the review. Sorry for making you go back and forth so many times.
I have revised the integ test again.​​​​​​​​​​​​​​​​

shikha372
shikha372 previously approved these changes Jun 13, 2024
Copy link
Contributor

mergify bot commented Jun 13, 2024

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).

@aws-cdk-automation aws-cdk-automation removed the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Jun 13, 2024
@mergify mergify bot dismissed shikha372’s stale review June 14, 2024 00:10

Pull request has been modified.

@mazyu36
Copy link
Contributor Author

mazyu36 commented Jun 14, 2024

@shikha372
Thank you for the review.
The integration test failed, so I ran it again, and it seems that there is a difference in an area unrelated to this modification. Would it be okay to push again?

  CHANGED    aws-ec2/test/integ.instance-nitro-enclaves-hibernation 0.777s
      Mappings
[+] Mapping LatestNodeRuntimeMap: {"af-south-1":{"value":"nodejs20.x"},"ap-east-1":{"value":"nodejs20.x"},"ap-northeast-1":{"value":"nodejs20.x"},"ap-northeast-2":{"value":"nodejs20.x"},"ap-northeast-3":{"value":"nodejs20.x"},"ap-south-1":{"value":"nodejs20.x"},"ap-south-2":{"value":"nodejs20.x"},"ap-southeast-1":{"value":"nodejs20.x"},"ap-southeast-2":{"value":"nodejs20.x"},"ap-southeast-3":{"value":"nodejs20.x"},"ap-southeast-4":{"value":"nodejs20.x"},"ca-central-1":{"value":"nodejs20.x"},"cn-north-1":{"value":"nodejs18.x"},"cn-northwest-1":{"value":"nodejs18.x"},"eu-central-1":{"value":"nodejs20.x"},"eu-central-2":{"value":"nodejs20.x"},"eu-north-1":{"value":"nodejs20.x"},"eu-south-1":{"value":"nodejs20.x"},"eu-south-2":{"value":"nodejs20.x"},"eu-west-1":{"value":"nodejs20.x"},"eu-west-2":{"value":"nodejs20.x"},"eu-west-3":{"value":"nodejs20.x"},"il-central-1":{"value":"nodejs20.x"},"me-central-1":{"value":"nodejs20.x"},"me-south-1":{"value":"nodejs20.x"},"sa-east-1":{"value":"nodejs20.x"},"us-east-1":{"value":"nodejs20.x"},"us-east-2":{"value":"nodejs20.x"},"us-gov-east-1":{"value":"nodejs18.x"},"us-gov-west-1":{"value":"nodejs18.x"},"us-iso-east-1":{"value":"nodejs18.x"},"us-iso-west-1":{"value":"nodejs18.x"},"us-isob-east-1":{"value":"nodejs18.x"},"us-west-1":{"value":"nodejs20.x"},"us-west-2":{"value":"nodejs20.x"}}

Resources
[~] AWS::Lambda::Function CustomVpcRestrictDefaultSGCustomResourceProviderHandlerDC833E5E 
 └─ [~] Runtime
     └─ @@ -1,1 +1,9 @@
        [-] "nodejs18.x"
        [+] {
        [+]   "Fn::FindInMap": [
        [+]     "LatestNodeRuntimeMap",
        [+]     {
        [+]       "Ref": "AWS::Region"
        [+]     },
        [+]     "value"
        [+]   ]
        [+] }

@shikha372
Copy link
Contributor

@shikha372 Thank you for the review. The integration test failed, so I ran it again, and it seems that there is a difference in an area unrelated to this modification. Would it be okay to push again?

  CHANGED    aws-ec2/test/integ.instance-nitro-enclaves-hibernation 0.777s
      Mappings
[+] Mapping LatestNodeRuntimeMap: {"af-south-1":{"value":"nodejs20.x"},"ap-east-1":{"value":"nodejs20.x"},"ap-northeast-1":{"value":"nodejs20.x"},"ap-northeast-2":{"value":"nodejs20.x"},"ap-northeast-3":{"value":"nodejs20.x"},"ap-south-1":{"value":"nodejs20.x"},"ap-south-2":{"value":"nodejs20.x"},"ap-southeast-1":{"value":"nodejs20.x"},"ap-southeast-2":{"value":"nodejs20.x"},"ap-southeast-3":{"value":"nodejs20.x"},"ap-southeast-4":{"value":"nodejs20.x"},"ca-central-1":{"value":"nodejs20.x"},"cn-north-1":{"value":"nodejs18.x"},"cn-northwest-1":{"value":"nodejs18.x"},"eu-central-1":{"value":"nodejs20.x"},"eu-central-2":{"value":"nodejs20.x"},"eu-north-1":{"value":"nodejs20.x"},"eu-south-1":{"value":"nodejs20.x"},"eu-south-2":{"value":"nodejs20.x"},"eu-west-1":{"value":"nodejs20.x"},"eu-west-2":{"value":"nodejs20.x"},"eu-west-3":{"value":"nodejs20.x"},"il-central-1":{"value":"nodejs20.x"},"me-central-1":{"value":"nodejs20.x"},"me-south-1":{"value":"nodejs20.x"},"sa-east-1":{"value":"nodejs20.x"},"us-east-1":{"value":"nodejs20.x"},"us-east-2":{"value":"nodejs20.x"},"us-gov-east-1":{"value":"nodejs18.x"},"us-gov-west-1":{"value":"nodejs18.x"},"us-iso-east-1":{"value":"nodejs18.x"},"us-iso-west-1":{"value":"nodejs18.x"},"us-isob-east-1":{"value":"nodejs18.x"},"us-west-1":{"value":"nodejs20.x"},"us-west-2":{"value":"nodejs20.x"}}

Resources
[~] AWS::Lambda::Function CustomVpcRestrictDefaultSGCustomResourceProviderHandlerDC833E5E 
 └─ [~] Runtime
     └─ @@ -1,1 +1,9 @@
        [-] "nodejs18.x"
        [+] {
        [+]   "Fn::FindInMap": [
        [+]     "LatestNodeRuntimeMap",
        [+]     {
        [+]       "Ref": "AWS::Region"
        [+]     },
        [+]     "value"
        [+]   ]
        [+] }

i see, yes this is expected after latest commit, integ test needs to be rerun and updated in this case.

@aws-cdk-automation aws-cdk-automation added the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Jun 14, 2024
@mazyu36
Copy link
Contributor Author

mazyu36 commented Jun 14, 2024

@shikha372
Thank you. I have fixed the integration test.
Could you please review and approve it again?

@shikha372
Copy link
Contributor

@Mergifyio update

Copy link
Contributor

mergify bot commented Jun 14, 2024

update

✅ Branch has been successfully updated

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

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

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

Copy link
Contributor

mergify bot commented Jun 14, 2024

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 4e9ef15 into aws:main Jun 14, 2024
10 checks passed
@aws-cdk-automation aws-cdk-automation removed the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Jun 14, 2024
mazyu36 added a commit to mazyu36/aws-cdk that referenced this pull request Jun 15, 2024
… Construct (aws#30228)

### Issue # (if applicable)
N/A

### Reason for this change
MIssing property in the L2 Construct


### Description of changes
Add nitroEnclaveEnabled and hibernationConfigured property.



### Description of how you validated changes
Added unit tests and integ tests.



### Checklist
- [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@mazyu36 mazyu36 deleted the ec2-enclave-hibernation branch June 18, 2024 14:37
sarangarav pushed a commit to sarangarav/aws-cdk that referenced this pull request Jun 21, 2024
… Construct (aws#30228)

### Issue # (if applicable)
N/A

### Reason for this change
MIssing property in the L2 Construct


### Description of changes
Add nitroEnclaveEnabled and hibernationConfigured property.



### Description of how you validated changes
Added unit tests and integ tests.



### Checklist
- [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
mazyu36 added a commit to mazyu36/aws-cdk that referenced this pull request Jun 22, 2024
… Construct (aws#30228)

### Issue # (if applicable)
N/A

### Reason for this change
MIssing property in the L2 Construct


### Description of changes
Add nitroEnclaveEnabled and hibernationConfigured property.



### Description of how you validated changes
Added unit tests and integ tests.



### Checklist
- [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)

----

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

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.

@aws aws locked as resolved and limited conversation to collaborators Jul 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
p2 repeat-contributor [Pilot] contributed between 3-5 PRs to the CDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants