generated from cds-snc/project-template
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
fix: tf module source syntax #323
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Guillaume Charest <guillaume.charest@cds-snc.ca>
sylviamclaughlin
approved these changes
Jul 10, 2023
base✅ Terraform Init: Plan: 4 to add, 0 to change, 4 to destroy Show summary
Show planResource actions are indicated with the following symbols:
+ create
- destroy
-/+ destroy and then create replacement
Terraform will perform the following actions:
# module.oidc.aws_iam_role.this[0] will be destroyed
# (because resource does not use count)
- resource "aws_iam_role" "this" {
- arn = "arn:aws:iam::794722365809:role/gh_plan_role" -> null
- assume_role_policy = jsonencode(
{
- Statement = [
- {
- Action = "sts:AssumeRoleWithWebIdentity"
- Condition = {
- StringLike = {
- "token.actions.githubusercontent.com:sub" = "repo:cds-snc/security-tools:*"
}
}
- Effect = "Allow"
- Principal = {
- Federated = "arn:aws:iam::794722365809:oidc-provider/token.actions.githubusercontent.com"
}
- Sid = ""
},
]
- Version = "2012-10-17"
}
) -> null
- create_date = "2022-05-13T13:14:57Z" -> null
- force_detach_policies = false -> null
- id = "gh_plan_role" -> null
- managed_policy_arns = [
- "arn:aws:iam::794722365809:policy/TFPlan",
- "arn:aws:iam::aws:policy/ReadOnlyAccess",
] -> null
- max_session_duration = 3600 -> null
- name = "gh_plan_role" -> null
- path = "/" -> null
- role_last_used = [
- {
- last_used_date = "2023-07-09T09:04:25Z"
- region = "ca-central-1"
},
] -> null
- tags = {
- "CostCentre" = "security-tools-794722365809"
- "Terraform" = "true"
} -> null
- tags_all = {
- "CostCentre" = "security-tools-794722365809"
- "Terraform" = "true"
} -> null
- unique_id = "AROA3SCJE6FYXRDNJ27BQ" -> null
- inline_policy {}
}
# module.oidc.aws_iam_role.this[1] will be destroyed
# (because resource does not use count)
- resource "aws_iam_role" "this" {
- arn = "arn:aws:iam::794722365809:role/gh_admin_role" -> null
- assume_role_policy = jsonencode(
{
- Statement = [
- {
- Action = "sts:AssumeRoleWithWebIdentity"
- Condition = {
- StringLike = {
- "token.actions.githubusercontent.com:sub" = "repo:cds-snc/security-tools:ref:refs/heads/main"
}
}
- Effect = "Allow"
- Principal = {
- Federated = "arn:aws:iam::794722365809:oidc-provider/token.actions.githubusercontent.com"
}
- Sid = ""
},
]
- Version = "2012-10-17"
}
) -> null
- create_date = "2022-05-13T13:14:57Z" -> null
- force_detach_policies = false -> null
- id = "gh_admin_role" -> null
- managed_policy_arns = [
- "arn:aws:iam::aws:policy/AdministratorAccess",
] -> null
- max_session_duration = 3600 -> null
- name = "gh_admin_role" -> null
- path = "/" -> null
- role_last_used = [
- {
- last_used_date = "2023-07-10T04:03:27Z"
- region = "ca-central-1"
},
] -> null
- tags = {
- "CostCentre" = "security-tools-794722365809"
- "Terraform" = "true"
} -> null
- tags_all = {
- "CostCentre" = "security-tools-794722365809"
- "Terraform" = "true"
} -> null
- unique_id = "AROA3SCJE6FYVGJADO6ZD" -> null
- inline_policy {}
}
# module.oidc.aws_iam_role.this["gh_admin_role"] will be created
+ resource "aws_iam_role" "this" {
+ arn = (known after apply)
+ assume_role_policy = jsonencode(
{
+ Statement = [
+ {
+ Action = "sts:AssumeRoleWithWebIdentity"
+ Condition = {
+ StringLike = {
+ "token.actions.githubusercontent.com:sub" = [
+ "repo:cds-snc/security-tools:ref:refs/heads/main",
]
}
}
+ Effect = "Allow"
+ Principal = {
+ Federated = "arn:aws:iam::794722365809:oidc-provider/token.actions.githubusercontent.com"
}
+ Sid = ""
},
]
+ Version = "2012-10-17"
}
)
+ create_date = (known after apply)
+ force_detach_policies = false
+ id = (known after apply)
+ managed_policy_arns = (known after apply)
+ max_session_duration = 3600
+ name = "gh_admin_role"
+ name_prefix = (known after apply)
+ path = "/"
+ role_last_used = (known after apply)
+ tags = {
+ "CostCentre" = "security-tools-794722365809"
+ "Terraform" = "true"
}
+ tags_all = {
+ "CostCentre" = "security-tools-794722365809"
+ "Terraform" = "true"
}
+ unique_id = (known after apply)
+ inline_policy {
+ name = (known after apply)
+ policy = (known after apply)
}
}
# module.oidc.aws_iam_role.this["gh_plan_role"] will be created
+ resource "aws_iam_role" "this" {
+ arn = (known after apply)
+ assume_role_policy = jsonencode(
{
+ Statement = [
+ {
+ Action = "sts:AssumeRoleWithWebIdentity"
+ Condition = {
+ StringLike = {
+ "token.actions.githubusercontent.com:sub" = [
+ "repo:cds-snc/security-tools:*",
]
}
}
+ Effect = "Allow"
+ Principal = {
+ Federated = "arn:aws:iam::794722365809:oidc-provider/token.actions.githubusercontent.com"
}
+ Sid = ""
},
]
+ Version = "2012-10-17"
}
)
+ create_date = (known after apply)
+ force_detach_policies = false
+ id = (known after apply)
+ managed_policy_arns = (known after apply)
+ max_session_duration = 3600
+ name = "gh_plan_role"
+ name_prefix = (known after apply)
+ path = "/"
+ role_last_used = (known after apply)
+ tags = {
+ "CostCentre" = "security-tools-794722365809"
+ "Terraform" = "true"
}
+ tags_all = {
+ "CostCentre" = "security-tools-794722365809"
+ "Terraform" = "true"
}
+ unique_id = (known after apply)
+ inline_policy {
+ name = (known after apply)
+ policy = (known after apply)
}
}
# module.vpc.aws_network_acl_rule.block_rdp[0] must be replaced
-/+ resource "aws_network_acl_rule" "block_rdp" {
~ cidr_block = "10.0.0.0/16" -> "0.0.0.0/0" # forces replacement
~ id = "nacl-1544954046" -> (known after apply)
~ protocol = "6" -> "tcp"
# (6 unchanged attributes hidden)
}
# module.vpc.aws_network_acl_rule.block_ssh[0] must be replaced
-/+ resource "aws_network_acl_rule" "block_ssh" {
~ cidr_block = "10.0.0.0/16" -> "0.0.0.0/0" # forces replacement
~ id = "nacl-3350424785" -> (known after apply)
~ protocol = "6" -> "tcp"
# (6 unchanged attributes hidden)
}
Plan: 4 to add, 0 to change, 4 to destroy.
Warning: Argument is deprecated
with module.athena.aws_s3_bucket.this,
on .terraform/modules/athena/S3/main.tf line 7, in resource "aws_s3_bucket" "this":
7: resource "aws_s3_bucket" "this" {
Use the aws_s3_bucket_server_side_encryption_configuration resource instead
(and 9 more similar warnings elsewhere)
─────────────────────────────────────────────────────────────────────────────
Saved the plan to: plan.tfplan
To perform exactly these actions, run the following command to apply:
terraform apply "plan.tfplan"
Show Conftest resultsWARN - plan.json - main - Missing Common Tags: ["aws_iam_user.security_tools"]
WARN - plan.json - main - Missing Common Tags: ["module.attach_tf_plan_policy.aws_iam_policy.this"]
19 tests, 17 passed, 2 warnings, 0 failures, 0 exceptions
|
csp_violation_report_service✅ Terraform Init: Plan: 1 to add, 0 to change, 0 to destroy Show summary
Show planResource actions are indicated with the following symbols:
+ create
Terraform will perform the following actions:
# module.purge_csp_reports_lambda.aws_cloudwatch_query_definition.lambda_statistics will be created
+ resource "aws_cloudwatch_query_definition" "lambda_statistics" {
+ id = (known after apply)
+ log_group_names = [
+ "aws_cloudwatch_log_group.this",
]
+ name = "Lambda Statistics - purge_stale_reports"
+ query_definition_id = (known after apply)
+ query_string = <<-EOT
filter @type = “REPORT”
| stats
count(@type) as countInvocations,
count(@initDuration) as countColdStarts, (count(@initDuration)/count(@type))*100 as percentageColdStarts,
max(@initDuration) as maxColdStartTime,
avg(@duration) as averageDuration,
max(@duration) as maxDuration,
min(@duration) as minDuration,
avg(@maxMemoryUsed) as averageMemoryUsed,
max(@memorySize) as memoryAllocated, (avg(@maxMemoryUsed)/max(@memorySize))*100 as percentageMemoryUsed
by bin(1h) as timeFrame
EOT
}
Plan: 1 to add, 0 to change, 0 to destroy.
Warning: Argument is deprecated
with aws_ecs_cluster.csp_reports,
on ecs.tf line 1, in resource "aws_ecs_cluster" "csp_reports":
1: resource "aws_ecs_cluster" "csp_reports" {
Use the aws_ecs_cluster_capacity_providers resource instead
(and 3 more similar warnings elsewhere)
─────────────────────────────────────────────────────────────────────────────
Saved the plan to: plan.tfplan
To perform exactly these actions, run the following command to apply:
terraform apply "plan.tfplan"
Show Conftest resultsWARN - plan.json - main - Missing Common Tags: ["aws_ecs_service.csp_reports"]
18 tests, 17 passed, 1 warning, 0 failures, 0 exceptions
|
3 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary | Résumé
Fix TF module source syntax