From 81697f1b4c748392a452e86622db36640e9af51c Mon Sep 17 00:00:00 2001 From: murad-ali-MoJ Date: Mon, 2 Oct 2023 14:40:51 +0100 Subject: [PATCH 1/7] add pulumi preview --- .github/workflows/pulumi_preview.yaml | 41 +++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/pulumi_preview.yaml diff --git a/.github/workflows/pulumi_preview.yaml b/.github/workflows/pulumi_preview.yaml new file mode 100644 index 0000000..da7d614 --- /dev/null +++ b/.github/workflows/pulumi_preview.yaml @@ -0,0 +1,41 @@ +name: Pulumi Preview +on: + pull_request: + branches: + - main +permissions: + id-token: write + contents: read +jobs: + preview: + name: Pulumi Preview + runs-on: ubuntu-latest + steps: + - name: Check out repository + uses: actions/checkout@v3 + with: + fetch-depth: 1 + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v2 + with: + aws-region: eu-west-1 + role-to-assume: arn:aws:iam::593291632749:role/data-engineering-ga-exports + role-session-name: githubaction + role-skip-session-tagging: true + role-duration-seconds: 3600 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.10" + - name: Install Python dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + - name: Pulumi Preview + uses: pulumi/actions@v4 + env: + PULUMI_CONFIG_PASSPHRASE: "" + with: + command: preview + stack-name: "data-engineering-exports" + cloud-url: s3://data-engineering-pulumi.analytics.justice.gov.uk \ No newline at end of file From 2975765cd1af6ad1937c368212617ba1504029a4 Mon Sep 17 00:00:00 2001 From: murad-ali-MoJ Date: Tue, 3 Oct 2023 10:07:58 +0100 Subject: [PATCH 2/7] add_pull_test --- pull_datasets/pull_pulumi_test.yaml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 pull_datasets/pull_pulumi_test.yaml diff --git a/pull_datasets/pull_pulumi_test.yaml b/pull_datasets/pull_pulumi_test.yaml new file mode 100644 index 0000000..4230fee --- /dev/null +++ b/pull_datasets/pull_pulumi_test.yaml @@ -0,0 +1,5 @@ +name: pull-test +pull_arns: + - arn:aws:iam::684969100054:role/restricted-admin +users: + - alpha_user_murad-ali-moj \ No newline at end of file From d308a80811e02cfa4dbd8f2aef787cfa2daa07b9 Mon Sep 17 00:00:00 2001 From: murad-ali-MoJ Date: Tue, 3 Oct 2023 14:21:47 +0100 Subject: [PATCH 3/7] change the roles --- pull_datasets/pull_pulumi_test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pull_datasets/pull_pulumi_test.yaml b/pull_datasets/pull_pulumi_test.yaml index 4230fee..3d5c8db 100644 --- a/pull_datasets/pull_pulumi_test.yaml +++ b/pull_datasets/pull_pulumi_test.yaml @@ -1,5 +1,5 @@ name: pull-test pull_arns: - - arn:aws:iam::684969100054:role/restricted-admin + - arn:aws:iam::684969100054:role/k8s-admin-role users: - alpha_user_murad-ali-moj \ No newline at end of file From 30a5c800586b98e3ea14ab264e9de1833e353a62 Mon Sep 17 00:00:00 2001 From: murad-ali-MoJ Date: Wed, 4 Oct 2023 11:16:32 +0100 Subject: [PATCH 4/7] Pulumi_up added --- .github/workflows/pulumi_up.yaml | 40 ++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/pulumi_up.yaml diff --git a/.github/workflows/pulumi_up.yaml b/.github/workflows/pulumi_up.yaml new file mode 100644 index 0000000..08ff1d1 --- /dev/null +++ b/.github/workflows/pulumi_up.yaml @@ -0,0 +1,40 @@ +name: Pulumi Up +on: + push: + branches: + - main +permissions: + id-token: write + contents: read +jobs: + up: + name: Pulumi Up + runs-on: ubuntu-latest + steps: + - name: Check out repository + uses: actions/checkout@v3 + with: + fetch-depth: 1 + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v2 + with: + aws-region: eu-west-1 + role-to-assume: arn:aws:iam::593291632749:role/data-engineering-ga-exports + role-session-name: githubaction + role-skip-session-tagging: true + role-duration-seconds: 3600 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.10" + - name: Install Python dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + - name: Pulumi Up + uses: pulumi/actions@v4 + env: + PULUMI_CONFIG_PASSPHRASE: "" + with: + command: up + stack-name: "data-engineering-exports" \ No newline at end of file From db728f4ffc70387404cfdc460e92ec8dbd738704 Mon Sep 17 00:00:00 2001 From: murad-ali-MoJ Date: Wed, 4 Oct 2023 11:24:38 +0100 Subject: [PATCH 5/7] added cloud-url --- .github/workflows/pulumi_up.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pulumi_up.yaml b/.github/workflows/pulumi_up.yaml index 08ff1d1..2b1e30d 100644 --- a/.github/workflows/pulumi_up.yaml +++ b/.github/workflows/pulumi_up.yaml @@ -37,4 +37,5 @@ jobs: PULUMI_CONFIG_PASSPHRASE: "" with: command: up - stack-name: "data-engineering-exports" \ No newline at end of file + stack-name: "data-engineering-exports" + cloud-url: s3://data-engineering-pulumi.analytics.justice.gov.uk \ No newline at end of file From cd96005b4472376345675847040190ef0fa7135e Mon Sep 17 00:00:00 2001 From: murad-ali-MoJ Date: Wed, 4 Oct 2023 15:27:09 +0100 Subject: [PATCH 6/7] autometed deplyment using pulumi --- pull_datasets/pull_pulumi_test.yaml | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 pull_datasets/pull_pulumi_test.yaml diff --git a/pull_datasets/pull_pulumi_test.yaml b/pull_datasets/pull_pulumi_test.yaml deleted file mode 100644 index 3d5c8db..0000000 --- a/pull_datasets/pull_pulumi_test.yaml +++ /dev/null @@ -1,5 +0,0 @@ -name: pull-test -pull_arns: - - arn:aws:iam::684969100054:role/k8s-admin-role -users: - - alpha_user_murad-ali-moj \ No newline at end of file From afdc640c58e0e2fbe8f7700e2da6f02106178106 Mon Sep 17 00:00:00 2001 From: murad-ali-MoJ Date: Wed, 4 Oct 2023 15:29:55 +0100 Subject: [PATCH 7/7] Automted deployment using pulumi