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

Remove deprecated managed policy arn ref #498

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

richgreen-moj
Copy link
Contributor

@richgreen-moj richgreen-moj commented Dec 9, 2024

We get persistent warnings that managed_policy_arn is deprecated.

Replace this with resource aws_iam_role_policy_attachment in response to deployment warnings:

│ Warning: Argument is deprecated
│ 
│   with module.baseline.module.ec2_instance["t1-ncr-db-1-a"].aws_iam_role.this,
│   on .terraform/modules/baseline.ec2_instance/main.tf line 343, in resource "aws_iam_role" "this":
│  343:   managed_policy_arns = var.instance_profile_policies
│ 
│ The managed_policy_arns argument is deprecated. Use the
│ aws_iam_role_policy_attachment resource instead. If Terraform should
│ exclusively manage all managed policy attachments (the current behavior of
│ this argument), use the aws_iam_role_policy_attachments_exclusive resource
│ as well.

@richgreen-moj richgreen-moj requested a review from a team as a code owner December 9, 2024 13:57
Copy link
Contributor

github-actions bot commented Dec 9, 2024

Trivy Scan Success

Show Output ```hcl

Trivy will check the following folders:

</details> #### `Checkov Scan` Success
<details><summary>Show Output</summary>

```hcl

*****************************

Checkov will check the following folders:

CTFLint Scan Success

Show Output
*****************************

Setting default tflint config...
Running tflint --init...
Installing "terraform" plugin...
Installed "terraform" (source: github.com/terraform-linters/tflint-ruleset-terraform, version: 0.9.1)
tflint will check the following folders:

Trivy Scan Success

Show Output
*****************************

Trivy will check the following folders:

3 similar comments
Copy link
Contributor

github-actions bot commented Dec 9, 2024

Trivy Scan Success

Show Output ```hcl

Trivy will check the following folders:

</details> #### `Checkov Scan` Success
<details><summary>Show Output</summary>

```hcl

*****************************

Checkov will check the following folders:

CTFLint Scan Success

Show Output
*****************************

Setting default tflint config...
Running tflint --init...
Installing "terraform" plugin...
Installed "terraform" (source: github.com/terraform-linters/tflint-ruleset-terraform, version: 0.9.1)
tflint will check the following folders:

Trivy Scan Success

Show Output
*****************************

Trivy will check the following folders:

Copy link
Contributor

Trivy Scan Success

Show Output ```hcl

Trivy will check the following folders:

</details> #### `Checkov Scan` Success
<details><summary>Show Output</summary>

```hcl

*****************************

Checkov will check the following folders:

CTFLint Scan Success

Show Output
*****************************

Setting default tflint config...
Running tflint --init...
Installing "terraform" plugin...
Installed "terraform" (source: github.com/terraform-linters/tflint-ruleset-terraform, version: 0.9.1)
tflint will check the following folders:

Trivy Scan Success

Show Output
*****************************

Trivy will check the following folders:

Copy link
Contributor

Trivy Scan Success

Show Output ```hcl

Trivy will check the following folders:

</details> #### `Checkov Scan` Success
<details><summary>Show Output</summary>

```hcl

*****************************

Checkov will check the following folders:

CTFLint Scan Success

Show Output
*****************************

Setting default tflint config...
Running tflint --init...
Installing "terraform" plugin...
Installed "terraform" (source: github.com/terraform-linters/tflint-ruleset-terraform, version: 0.9.1)
tflint will check the following folders:

Trivy Scan Success

Show Output
*****************************

Trivy will check the following folders:

Copy link
Contributor

Trivy Scan Success

Show Output ```hcl

Trivy will check the following folders:

</details> #### `Checkov Scan` Success
<details><summary>Show Output</summary>

```hcl

*****************************

Checkov will check the following folders:

CTFLint Scan Success

Show Output
*****************************

Setting default tflint config...
Running tflint --init...
Installing "terraform" plugin...
Installed "terraform" (source: github.com/terraform-linters/tflint-ruleset-terraform, version: 0.9.1)
tflint will check the following folders:

Trivy Scan Success

Show Output
*****************************

Trivy will check the following folders:

@richgreen-moj richgreen-moj changed the title Testing toset on list of strings Remove deprecated managed policy arn ref Dec 19, 2024
tags = merge(local.tags, {
Name = "${var.iam_resource_names_prefix}-role-${var.name}"
})
}

# IAM role policy attachment
resource "aws_iam_role_policy_attachment" "this" {
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks all good, but calling it 'this' can we have a better 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.

I think if we change that it'd make sense to do a bigger overhaul of the module as I was just following the naming convention applied to most of the resources in this module. Perhaps that'd be a separate PR?

Also that could possibly cause all users upgrading to need to rebuild their resources just for the name change.

Copy link
Contributor

@ep-93 ep-93 left a comment

Choose a reason for hiding this comment

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

Comments addressed, approved!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants