diff --git a/.github/workflows/digger_workflow.yml b/.github/workflows/digger_workflow.yml new file mode 100644 index 0000000..b2bbc31 --- /dev/null +++ b/.github/workflows/digger_workflow.yml @@ -0,0 +1,43 @@ +name: Digger Workflow + +on: + workflow_dispatch: + inputs: + id: + description: 'run identifier' + required: false + job: + required: true + comment_id: + required: true + run_name: + required: false + +run-name: ${{ inputs.run_name }} + +jobs: + digger-job: + runs-on: ubuntu-latest + permissions: + contents: write # required to merge PRs + actions: write # required for plan persistence + id-token: write # required for workload-identity-federation + pull-requests: write # required to post PR comments + statuses: write # required to validate combined PR status + + steps: + - name: digger run ${{github.event.inputs.id}} + run: echo digger run ${{ inputs.id }} + shell: bash + - uses: actions/checkout@v4 + - uses: diggerhq/digger-ee@vLatest + with: + setup-aws: true + # recommended to use oidc instead + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + disable-locking: false + env: + GITHUB_CONTEXT: ${{ toJson(github) }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + DIGGER_LICENSE_KEY: ${{ secrets.DIGGER_LICENSE_KEY }} \ No newline at end of file diff --git a/.github/workflows/drift.yml b/.github/workflows/drift.yml new file mode 100644 index 0000000..e69de29 diff --git a/dev-ec2/main.tf b/dev-ec2/main.tf new file mode 100644 index 0000000..e60cbb9 --- /dev/null +++ b/dev-ec2/main.tf @@ -0,0 +1,6 @@ + +resource "aws_ssm_parameter" "foo" { + name = "dev/ec2" + type = "String" + value = "ec2 instance" +} diff --git a/dev-vpc/main.tf b/dev-vpc/main.tf new file mode 100644 index 0000000..582e681 --- /dev/null +++ b/dev-vpc/main.tf @@ -0,0 +1,7 @@ + + +resource "aws_ssm_parameter" "foo" { + name = "dev/vpc" + type = "String" + value = "10.10.10.0/32" +} diff --git a/digger.yml b/digger.yml new file mode 100644 index 0000000..3c85f5d --- /dev/null +++ b/digger.yml @@ -0,0 +1,14 @@ + + +projects: + - name: dev-vpc + dir: dev-vpc + - name: dev-ec2 + dir: dev-ec2 + depends_on: ["dev-vpc"] + - name: prod-vpc + dir: prod-vpc + - name: prod-ec2 + dir: prod-ec2 + depends_on: ["prod-vpc"] + diff --git a/prod-ec2/main.tf b/prod-ec2/main.tf new file mode 100644 index 0000000..19f4ddd --- /dev/null +++ b/prod-ec2/main.tf @@ -0,0 +1,6 @@ + +resource "aws_ssm_parameter" "foo" { + name = "prod/ec2" + type = "String" + value = "ec2 prod" +} diff --git a/prod-vpc/main.tf b/prod-vpc/main.tf new file mode 100644 index 0000000..db711cd --- /dev/null +++ b/prod-vpc/main.tf @@ -0,0 +1,7 @@ + + +resource "aws_ssm_parameter" "foo" { + name = "prod/vpc" + type = "String" + value = "11.10.10.0/32" +}