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

Move to GitOps Config File #29

Merged
merged 21 commits into from
Dec 13, 2023
Merged

Move to GitOps Config File #29

merged 21 commits into from
Dec 13, 2023

Conversation

goruha
Copy link
Member

@goruha goruha commented Dec 5, 2023

What

  • Use configuration file

Why

  • Make DRY workflows

Migrating from v1 to v2

v2 drop component-path variable. Now it fetches from atmos.yaml file automatically.

v2 moved variables from inputs to atmos gitops config path ./.github/config/atmos-gitops.yaml

name
atmos-version
atmos-config-path
terraform-state-bucket
terraform-state-table
terraform-state-role
terraform-plan-role
terraform-apply-role
terraform-version
aws-region
enable-infracost

If you want the same behavior in v2 as inv1 you should create config ./.github/config/atmos-gitops.yaml with the same variables as in v1 inputs.

  - name: Terraform apply
    uses: cloudposse/github-action-atmos-terraform-apply@v2
    with:
      atmos-gitops-config-path: ./.github/config/atmos-gitops.yaml
      component: "foobar"
      stack: "plat-ue2-sandbox"

same behaviour as

  - name: Terraform apply
    uses: cloudposse/github-action-atmos-terraform-apply@v1
    with:
      component: "foobar"
      stack: "plat-ue2-sandbox"
      component-path: "components/terraform/s3-bucket"
      terraform-apply-role: "arn:aws:iam::111111111111:role/acme-core-gbl-identity-gitops"
      terraform-state-bucket: "acme-core-ue2-auto-gitops"
      terraform-state-role: "arn:aws:iam::999999999999:role/acme-core-ue2-auto-gitops-gha"
      terraform-state-table: "acme-core-ue2-auto-gitops"
      aws-region: "us-east-2"

@goruha goruha added the major Breaking changes (or first stable release) label Dec 5, 2023
@goruha goruha requested review from a team as code owners December 5, 2023 01:08
@goruha goruha requested review from jamengual and korenyoni December 5, 2023 01:08
@osterman osterman changed the title Incapsulate configs Use configuration file Dec 9, 2023
Copy link
Member

@milldr milldr left a comment

Choose a reason for hiding this comment

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

see comments

README.yaml Outdated Show resolved Hide resolved
action.yml Outdated
echo "ACTIONS_ENABLED=true" >> $GITHUB_ENV
else
echo "ACTIONS_ENABLED=false" >> $GITHUB_ENV
fi

- name: Find component path
if: env.ACTIONS_ENABLED == 'true'
uses: cloudposse/github-action-atmos-get-setting@retrive-general-settings
Copy link
Member

Choose a reason for hiding this comment

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

can we point back to an action version?

Copy link
Member Author

Choose a reason for hiding this comment

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

action.yml Outdated Show resolved Hide resolved
README.yaml Outdated Show resolved Hide resolved
README.yaml Outdated Show resolved Hide resolved
Comment on lines +64 to +65
terraform-state-bucket: cptest-core-ue2-auto-gitops
terraform-state-table: cptest-core-ue2-auto-gitops
Copy link
Member

Choose a reason for hiding this comment

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

We have to rename these. These are not for the Terraform State Bucket. These are for the Terraform Plan File.

Copy link
Member Author

Choose a reason for hiding this comment

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

Let's add this task to the backlog

Choose a reason for hiding this comment

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

atmos-config-path: ./rootfs/usr/local/etc/atmos/
terraform-state-bucket: cptest-core-ue2-auto-gitops
terraform-state-table: cptest-core-ue2-auto-gitops
terraform-state-role: arn:aws:iam::xxxxxxxxxxxx:role/cptest-core-ue2-auto-gitops-gha
Copy link
Member

Choose a reason for hiding this comment

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

Same

Copy link
Member Author

Choose a reason for hiding this comment

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

Let's add this task to the backlog

Choose a reason for hiding this comment

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

README.yaml Outdated Show resolved Hide resolved
README.yaml Outdated Show resolved Hide resolved
@osterman osterman changed the title Use configuration file Move to GitOps Config File Dec 11, 2023
goruha and others added 3 commits December 12, 2023 00:08
Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <[email protected]>
Co-authored-by: Dan Miller <[email protected]>
Copy link
Member

@osterman osterman left a comment

Choose a reason for hiding this comment

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

Rebuild README

@goruha goruha merged commit 75e5571 into main Dec 13, 2023
5 checks passed
@goruha goruha deleted the incapsulate-configs branch December 13, 2023 15:49
@goruha goruha restored the incapsulate-configs branch December 13, 2023 15:49
@goruha goruha deleted the incapsulate-configs branch January 31, 2024 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
major Breaking changes (or first stable release)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants