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

fix: DBTP-1534 - Assume role policy for the S3 migration were too strict so relaxing them #279

Merged
merged 6 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Addresses [DBTP-<ticket>](https://uktrade.atlassian.net/browse/DBTP-<ticket>)

Please add any relevant context for you pull request here, or delete this if none needed.

---
## Checklist:

### Title:
- [ ] Scope included as per [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/)
- [ ] Ticket reference included (unless it's a quick out of ticket thing)
### Description:
- [ ] Link to ticket included (unless it's a quick out of ticket thing)
- [ ] Includes tests (or an explanation for why it doesn't)
- [ ] Includes any applicable changes to the documentation in this code base
- [ ] Includes link(s) to any applicable changes to the documentation in the [DBT Platform Documentation](https://platform.readme.trade.gov.uk/) (can be to a pull request)
### Tasks:
- [ ] [Trigger the pull request regression tests for this branch](https://github.com/uktrade/platform-tools?tab=readme-ov-file#regression-tests) and confirm that they are passing
2 changes: 1 addition & 1 deletion environment-pipelines/iam.tf
Original file line number Diff line number Diff line change
Expand Up @@ -875,7 +875,7 @@ data "aws_iam_policy_document" "iam" {
actions = [
"iam:UpdateAssumeRolePolicy"
]
resources = [for environment in local.environment_config : "arn:aws:iam::${data.aws_caller_identity.current.account_id}:role/${var.application}-${environment.name}-shared-S3MigrationRole"]
resources = [for environment in local.environment_config : "arn:aws:iam::${data.aws_caller_identity.current.account_id}:role/*-S3MigrationRole"]
}

statement {
Expand Down
21 changes: 21 additions & 0 deletions terraform_tests.sh
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice

Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env bash

unit_test_files=$(find . -name "*tftest.hcl" | grep -v e2e-tests | sort)
modules=""
IFS=$'\n'
for file in $unit_test_files
do
# Lose leading ./ and select the part before the tests directory
module=$(echo "${file#./}" | awk -F "/tests/" '{print $1}')
# In case we separate the test files, only include each module once
if [[ "\"${modules}\"" != *"\"${module}\""* ]]; then
message="Running tests for module ${module}"
underline=$(echo "${message}" | sed "s/./=/g")
echo -en "\n\033[1;36m${message}\033[0m"
echo -e "\n\033[1;36m${underline}\033[0m"
pushd "${module}"
terraform init
terraform test
popd
antroy-madetech marked this conversation as resolved.
Show resolved Hide resolved
fi
done
Loading