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

added vpc endpoint to access secrets manager #15

Merged
merged 4 commits into from
Oct 15, 2023

Conversation

AgusPk
Copy link
Contributor

@AgusPk AgusPk commented Oct 12, 2023

What's this PR do?

Solves #10

Summary by CodeRabbit

  • New Feature: Added a new attribute region to the VPC module to specify the AWS region.
  • New Feature: Introduced an AWS VPC endpoint for Secrets Manager, enhancing security by enabling private connections between the VPC and Secrets Manager. This endpoint is associated with the private subnets of the VPC and a specified security group.
  • Refactor: Added a new variable "region" in the VPC module for better configurability and code reusability.

@coderabbitai
Copy link

coderabbitai bot commented Oct 12, 2023

Walkthrough

The changes primarily focus on enhancing the AWS VPC configuration by adding a new VPC endpoint for the Secrets Manager service. The region attribute is also introduced in the VPC module. The endpoint is associated with the private subnets of the VPC and a specific security group.

Changes

File Summary
live/core/vpc.tf Added a new attribute region to the module "vpc" block.
modules/vpc/variables.tf Introduced a new variable "region" to specify the AWS region.
modules/vpc/endpoints.tf Added a new resource block for an AWS VPC endpoint of type "secrets_manager". The endpoint is associated with the private subnets of the VPC and a specific security group.

🐇

"In the land of code, changes are afoot,

Secrets Manager now has a new route.

With regions and endpoints, oh what a treat,

Our VPC's power, none can beat! 🎉"


Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • Mention @coderabbitai in any review comment for bot assistance.
  • Note: Review comments are made on code diffs or files, not on the PR overview.

Pause Incremental Reviews

  • Insert @coderabbitai: ignore in the PR description to halt the bot's ongoing reviews. Remove the line to resume.
  • Additionally, enter @coderabbitai pause to halt the bot's ongoing reviews as any issue or review comment. To
    resume reviews, enter @coderabbitai resume as any issue or review comment.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Commits Files that changed from the base of the PR and between a0d922e and 96201b1.
Files selected for processing (3)
  • live/core/vpc.tf (1 hunks)
  • modules/vpc/endpoints.tf (1 hunks)
  • modules/vpc/variables.tf (1 hunks)
Files skipped from review due to trivial changes (2)
  • modules/vpc/endpoints.tf
  • modules/vpc/variables.tf
Additional comments (Suppressed): 1
live/core/vpc.tf (1)
  • 14-14: The new attribute region is added to the module "vpc" block. Ensure that the var.region variable is defined and correctly set in the environment where this module is used. Also, verify that the VPC module supports this attribute.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Commits Files that changed from the base of the PR and between 96201b1 and 8ffd97f.
Files selected for processing (1)
  • modules/vpc/endpoints.tf (1 hunks)
Additional comments (Suppressed): 1
modules/vpc/endpoints.tf (1)
  • 1-10: The new hunk introduces a VPC endpoint for AWS Secrets Manager. It correctly uses the current region to construct the service name and associates the endpoint with the appropriate security group and private subnets. However, it's important to verify that the module.app_security_group.security_group_id and module.vpc.private_subnets are correctly configured to allow traffic to and from the Secrets Manager endpoint. Also, ensure that the necessary IAM policies are in place to allow access to the Secrets Manager service.

Copy link
Member

@ulises-jeremias ulises-jeremias left a comment

Choose a reason for hiding this comment

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

🔥

@ulises-jeremias
Copy link
Member

@AgusPk just need to run terraform fmt in the file that is failing on CI, the rest is OK 👌🏻

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Commits Files that changed from the base of the PR and between 8ffd97f and ee88555.
Files selected for processing (1)
  • modules/vpc/endpoints.tf (1 hunks)
Additional comments (Suppressed): 1
modules/vpc/endpoints.tf (1)
  • 1-10: The new hunk introduces a VPC endpoint for AWS Secrets Manager. It uses the current region and VPC ID, and associates the endpoint with a specific security group and the private subnets of the VPC. This is a good security practice as it restricts access to the Secrets Manager to within the VPC, eliminating the need for internet-based access. However, ensure that the module.vpc.vpc_id, module.app_security_group.security_group_id, and module.vpc.private_subnets are correctly set and accessible in this context.

@ulises-jeremias ulises-jeremias merged commit c289b8a into nanlabs:main Oct 15, 2023
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants