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

Update_101224_3 #9041

Merged
merged 1 commit into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 7 additions & 10 deletions terraform/environments/ppud/iam.tf
Original file line number Diff line number Diff line change
Expand Up @@ -1204,16 +1204,6 @@ resource "aws_iam_policy" "iam_policy_for_lambda_cloudwatch_get_metric_data_dev"
"arn:aws:ssm:eu-west-2:${local.environment_management.account_ids["ppud-development"]}:parameter/klayers-account"
]
},
{
"Sid" : "EC2Policy",
"Effect" : "Allow",
"Action" : [
"ec2:DescribeInstances"
],
"Resource" : [
"arn:aws:ec2:eu-west-2:${local.environment_management.account_ids["ppud-development"]}:*"
]
},
{
"Sid" : "LogPolicy",
"Effect" : "Allow",
Expand Down Expand Up @@ -1277,6 +1267,13 @@ resource "aws_iam_policy_attachment" "attach_lambda_cloudwatch_full_access_dev"
policy_arn = "arn:aws:iam::aws:policy/CloudWatchFullAccessV2"
}

resource "aws_iam_policy_attachment" "attach_lambda_ec2_read_only_access_dev" {
count = local.is-development == true ? 1 : 0
name = "lambda-ec2-read-only-access-iam-attachment"
roles = [aws_iam_role.lambda_role_cloudwatch_get_metric_data_dev[0].id]
policy_arn = "arn:aws:iam::aws:policy/AmazonEC2ReadOnlyAccess"
}

#resource "aws_iam_policy_attachment" "attach_ses_full_access" {
# count = local.is-development == true ? 1 : 0
# name = "ses-full-access-iam-attachment"
Expand Down
6 changes: 3 additions & 3 deletions terraform/environments/ppud/instances.tf
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ resource "aws_instance" "s609693lo6vw102" {
instance_type = "m5.large"
source_dest_check = false
iam_instance_profile = aws_iam_instance_profile.ec2_profile.id
vpc_security_group_ids = [aws_security_group.Secondary-DOC-Server[0].id]
vpc_security_group_ids = [aws_security_group.Live-DOC-Server[0].id]
subnet_id = data.aws_subnet.private_subnets_c.id

metadata_options {
Expand All @@ -116,7 +116,7 @@ resource "aws_instance" "s609693lo6vw103" {
instance_type = "m5.large"
source_dest_check = false
iam_instance_profile = aws_iam_instance_profile.ec2_profile.id
vpc_security_group_ids = [aws_security_group.Primary-DOC-Server[0].id]
vpc_security_group_ids = [aws_security_group.Archive-DOC-Server[0].id]
subnet_id = data.aws_subnet.private_subnets_b.id

metadata_options {
Expand Down Expand Up @@ -599,7 +599,7 @@ resource "aws_instance" "s618358rgvw022" {
instance_type = "m5.xlarge"
source_dest_check = false
iam_instance_profile = aws_iam_instance_profile.ec2_profile.id
vpc_security_group_ids = [aws_security_group.Primary-DOC-Server[0].id]
vpc_security_group_ids = [aws_security_group.Archive-DOC-Server[0].id]
subnet_id = data.aws_subnet.private_subnets_b.id

metadata_options {
Expand Down
1 change: 1 addition & 0 deletions terraform/environments/ppud/security_group.tf
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ resource "aws_security_group_rule" "Dev-Servers-Standard-Egress-2" {
# Production

resource "aws_security_group" "Primary-DOC-Server" {
# checkov:skip=CKV2_AWS_5: "Temporarily unattached to any EC2 instances"
count = local.is-preproduction == false ? 1 : 0
vpc_id = data.aws_vpc.shared.id
name = "Primary-DOC-Server"
Expand Down
Loading