-
Notifications
You must be signed in to change notification settings - Fork 87
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
feat: Terraform example #1478
feat: Terraform example #1478
Conversation
Feat/terraform examples
Merge base
terraform -version | ||
cd examples/powertools-examples-core/terraform | ||
terraform init | ||
terraform validate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we do a plan
too ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your call, if you think it adds value to the build.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
terraform plan was added but terraform validate fails because there are no AWS credentials available in the CI environment. They are required by terraform AWS provider.
I tried, but was unsuccesful at adding
- name: Setup AWS credentials
uses: aws-actions/configure-aws-credentials@5fd3084 # v2.2.0
I can't reproduce this error in my environment so I'm struggling to fix it.
I suggest we simply configure the provider with region = "us-east-1" (or any other region) as it seems to pass
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe because you don't have permission to do that as it's from a fork
examples/powertools-examples-core/terraform/src/test/java/helloworld/AppTest.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still a few comments
Related to #1458 |
My previous comments were addressed! @skal111 do you mind updating the same PR next time, it makes it easier to see what's happened 💪 |
Yeah ok apologies, just found out you can update a PR :) |
…nged tf providers to pass tf validate
Codecov ReportAll modified lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #1478 +/- ##
=========================================
Coverage 78.58% 78.58%
Complexity 650 650
=========================================
Files 74 74
Lines 2508 2508
Branches 259 259
=========================================
Hits 1971 1971
Misses 455 455
Partials 82 82 ☔ View full report in Codecov by Sentry. |
…nged tf providers to pass tf validate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job thank you!
@@ -68,6 +68,27 @@ jobs: | |||
run: | | |||
cd examples/powertools-examples-core/gradle | |||
./gradlew build | |||
- name: Setup Terraform |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- name: Setup Terraform | |
- name: Setup AWS credentials | |
uses: aws-actions/configure-aws-credentials@5fd3084fc36e372ff1fff382a39b10d03659f355 # v2.2.0 | |
with: | |
role-to-assume: ${{ secrets.AWS_ROLE_ARN_TO_ASSUME }} | |
aws-region: ${{ env.AWS_REGION }} | |
- name: Setup Terraform |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you also need to add this after the env (line 56)
permissions:
id-token: write # needed to interact with GitHub's OIDC Token endpoint.
contents: read
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, let me try again
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry, I saw the build failing
Kudos, SonarCloud Quality Gate passed! |
Issue #, if available:
#1445
Description of changes:
Terraform example
TFLint and validate in the pr-build.yml
Included remarks from previous PR
Checklist
Breaking change checklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.