-
Notifications
You must be signed in to change notification settings - Fork 3
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 terraform action >=1.11.0 #1418
Conversation
📝 WalkthroughWalkthroughThis pull request modifies the backend configuration for the Terraform workflow in two action files. Specifically, it changes the source of the Azure subscription ID from an environment variable to an input parameter in both the Changes
Sequence Diagram(s)sequenceDiagram
participant Runner as GitHub Actions Runner
participant Workflow as CI Workflow
participant TF as Terraform CLI
participant Azure as Azure Backend
Runner->>Workflow: Trigger Terraform Workflow (Plan/Apply)
Workflow->>TF: Run 'terraform init' with backend-config (subscription_id)
TF->>Azure: Connect using provided backend configuration
Possibly related PRs
Suggested reviewers
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (12)
🚧 Files skipped from review as they are similar to previous changes (12)
⏰ Context from checks skipped due to timeout of 90000ms (1)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
actions/terraform/apply/action.yaml (1)
90-96
: Documentation Suggestion:
Consider adding an inline comment above these backend configuration lines explaining why these additional parameters are now required. This will aid future maintainers in understanding the context behind supporting Terraform versions >=1.11.0.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (10)
actions/terraform/apply/action.yaml
(0 hunks)actions/terraform/plan/action.yaml
(0 hunks)actions/terraform/plan/action.yaml
(1 hunks)actions/terraform/plan/action.yaml
(1 hunks)actions/terraform/plan/action.yaml
(1 hunks)actions/terraform/plan/action.yaml
(1 hunks)actions/terraform/plan/action.yaml
(1 hunks)actions/terraform/plan/action.yaml
(1 hunks)actions/terraform/plan/action.yaml
(1 hunks)actions/terraform/apply/action.yaml
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Analyze (go)
🔇 Additional comments (3)
actions/terraform/apply/action.yaml (1)
90-96
: Enhance backend configuration for Terraform Init.
The addition of the backend configuration options
-backend-config="subscription_id=${{ env.ARM_SUBSCRIPTION_ID }}"
and
-backend-config="resource_group_name=${{ inputs.tf_arm_resource_group_name }}"
ensures that Terraform (v>=1.11.0) properly associates with the correct Azure subscription and resource group. This change improves compatibility with newer Terraform versions by explicitly passing the subscription ID and resource group name. Please verify that the environment variableARM_SUBSCRIPTION_ID
(sourced frominputs.tf_arm_subscription_id
) is consistently set across all workflow steps.actions/terraform/plan/action.yaml (2)
100-104
: Standardize Terraform Init backend configuration.
The updated lines now reference the subscription ID using${{ env.ARM_SUBSCRIPTION_ID }}
and explicitly pass the resource group name via
-backend-config="resource_group_name=${{ inputs.tf_arm_resource_group_name }}"
. These changes mirror those in the apply workflow, ensuring consistency in how Terraform accesses the Azure backend. Please confirm that these variable references correctly resolve during workflow execution.
90-97
: Verify Authentication Strategy Post-Azure Login Removal.
With the removal of the dedicated Azure login step and the use ofARM_USE_OIDC: "true"
, double-check that the OIDC-based authentication and the provided environment variables supply sufficient credentials for Terraform operations.
Terraform environment testFormat and Style 🖌
|
Context | Values |
---|---|
Pusher | @bengtfredh |
Action | push |
Working Directory | ./infrastructure/adminservices-test/admin-test-aks-rg |
State File | github.com/altinn/altinn-platform/environments/test/admin-test-aks-rg.tfstate |
Plan File | github.com_altinn_altinn-platform_environments_test_admin-test-aks-rg.tfstate.tfplan |
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.
Description
Adding subscription_id to backend config fixes issues with terraform >=1.11.0
Related Issue(s)
Verification
Documentation
Summary by CodeRabbit
New Features
Chores