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

Updated to support Terraform 1.3.X and latest #431

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

martwana
Copy link

@martwana martwana commented Dec 16, 2022

Proposed changes

Updated to support Terraform > v1.3.X. A few AWS resources that generated warnings have also been updated.

Swapped from data.template_file for templatefile() as there is no M1 support for the templates provider.

Added a TF output for the CodeBuild IAM role. If using a custom nuke config in a custom S3 bucket, you need to be able to grant this role access to the bucket. By outputting the name, you can create and IAM policy and attach it to the role.

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (changes to code, which do not change application behavior)

Checklist

  • I have filled out this PR template
  • I have read the CONTRIBUTING doc
  • I have added automated tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (README.md, inline comments, etc.)
  • I have updated the CHANGELOG.md under a ## next release, with a short summary of my changes

Relevant Links

N/A

Further comments

N/A

@CLAassistant
Copy link

CLAassistant commented Dec 16, 2022

CLA assistant check
All committers have signed the CLA.

Copy link
Collaborator

@shubydo shubydo left a comment

Choose a reason for hiding this comment

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

Left some comments. Any particular reason for 1.2.X instead of 1.3.X?

Makefile Outdated Show resolved Hide resolved
modules/artifacts_bucket.tf Outdated Show resolved Hide resolved
modules/versions.tf Outdated Show resolved Hide resolved
@martwana
Copy link
Author

@shubydo Think we may be good to merge this now?

… policies to it if using a custom bucket for nuke config
Copy link
Collaborator

@shubydo shubydo left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for the contribution @martwana !

There's a status check that is still pending that appears to not be triggering the current pipeline that runs during PRs. This may be due to the current pipeline not automatically running for forked branches or another reason (given my current understanding). Once we can get that triggered and it passes, let's merge this.

CC: @jrsholly

@shubydo
Copy link
Collaborator

shubydo commented Jan 14, 2023

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@martwana
Copy link
Author

Ah, your Azure Pipeline needs updated to use the new terraform version

Copy link
Collaborator

@shubydo shubydo left a comment

Choose a reason for hiding this comment

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

Current pipeline(s) failed because an earlier version of terraform is being used. Can you update the Terraform version in the following files as well?

I'd suggest using the version that matches the new version constraint you defined here

@shubydo
Copy link
Collaborator

shubydo commented Jan 20, 2023

@martwana the pipeline is failing on a certain step which is why the status checks aren't passing for this PR. #433 should fix it hopefully :)

Edit: Looks like it failed, but the check isn't reflecting this

modules/gateway.tf Outdated Show resolved Hide resolved
martwana and others added 2 commits March 20, 2023 10:47
…ng individual values.

Co-authored-by: Jack Shubatt <shubydo777@gmail.com>
@martwana martwana requested review from shubydo and removed request for jrsholly March 20, 2023 10:49
@shubydo shubydo changed the title Updated to support Terraform 1.2.X and latest Updated to support Terraform 1.3.X and latest Mar 21, 2023
shubydo
shubydo previously approved these changes May 23, 2023
@dutsmiller
Copy link

Can this be merged?

@martwana
Copy link
Author

@shubydo What are the steps left to take to get this into master. I'd really like to ditch my fork and start tracking Optum/dce.

@shubydo
Copy link
Collaborator

shubydo commented Jun 29, 2023

@shubydo What are the steps left to take to get this into master. I'd really like to ditch my fork and start tracking Optum/dce.

@martwana sorry for the very delayed response. I am no longer actively on this project, so I'll defer to @dilip0515.

@dilip0515 since this is a larger, potentially breaking, change for certain users if they are pointing at the master branch, it might be good to bump the next release version to v0.40.0 or v0.35.0

@stv-io
Copy link

stv-io commented Oct 6, 2023

As someone "coming from the internet" and a new user of DCE, I would like to nudge this conversation, as my organisation would benefit from this PR being merged as well.

FWIW the terraform changes LGTM and the README changes are also complete.

change_trigger = sha256(data.template_file.api_swagger.rendered)
triggers = {
redeployment = sha1(jsonencode(aws_api_gateway_rest_api.gateway_api.body))
}
Copy link

Choose a reason for hiding this comment

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

@martwana it seems like the syntax here isn't working:

terraform plan

│ Error: Incorrect attribute value type

│   on .terraform/modules/dce/modules/gateway.tf line 115, in resource "aws_api_gateway_deployment" "gateway_deployment":
│  115:   variables = {
│  116:     // API Changes won't get deployed, without a trigger in TF
│  117:     // See https://medium.com/coryodaniel/til-forcing-terraform-to-deploy-a-aws-api-gateway-deployment-ed36a9f60c1a
│  118:     // and https://github.com/terraform-providers/terraform-provider-aws/issues/162#issuecomment-475323730
│  119:   triggers = {
│  120:     redeployment = sha1(jsonencode(aws_api_gateway_rest_api.gateway_api.body))
│  121:   }
│  122:   }

│ Inappropriate value for attribute "variables": element "triggers": string required.

fixed (or removed the error on plan) by removing the "reployment" key:

resource "aws_api_gateway_deployment" "gateway_deployment" {
  rest_api_id = aws_api_gateway_rest_api.gateway_api.id

  variables = {
    triggers = sha1(jsonencode(aws_api_gateway_rest_api.gateway_api.body))
  }

  lifecycle {
    create_before_destroy = true
  }
}

calebikhuohon added a commit to infernonhq/dce that referenced this pull request Oct 18, 2023
This change is sourced from Optum#431
@jfrconley
Copy link

I am also hoping this gets merged soon, 0.13.7 is too old for our use case

@bjfish25
Copy link
Contributor

This pr has been accomplished at least in part by the prs:

@martwana If there is something you still want merged be free to request my review. Otherwise I'll look to close this as accomplished in by other prs.

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.

None yet

7 participants