Skip to content

Add default S3 submission role ARN for local development - #2269

Open
lfdebrux wants to merge 2 commits into
mainfrom
ldeb-add-s3-submission-iam-role-arn
Open

Add default S3 submission role ARN for local development#2269
lfdebrux wants to merge 2 commits into
mainfrom
ldeb-add-s3-submission-iam-role-arn

Conversation

@lfdebrux

@lfdebrux lfdebrux commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

What problem does this pull request solve?

When running forms-runner locally, we want to be able to test S3 submissions. Using the ASSUME_DEV_IAM_ROLE flag allows that, but only when the S3 submissions role in the development environment is also provided. The role ARN is defined in forms-deploy [1], but using it locally is not well documented.

This commit adds the role ARN to the default configuration for local development. This should make it possible to test S3 submissions just by using the ASSUME_DEV_IAM_ROLE feature without further configuration.

Things to consider when reviewing

  • Ensure that you consider the wider context.
  • Does it work when run on your machine?
  • Is it clear what the code is doing?
  • Do the commit messages explain why the changes were made?
  • Are there all the unit tests needed?
  • Do the end to end tests need updating before these changes will pass?
  • Has all relevant documentation been updated?

When assuming the development readonly role in AWS, the role session
name is derived from the UNIX username, for information purposes.
However, when running forms-runner in a Docker container, the $USER is
always `ruby`, which isn't very informative.

This commit adds code to get the user name from $AWS_USER, if it is set.
This is not normally set, but a future PR in forms-deploy will update
the Docker Compose configuration for running forms locally to set it.
When running forms-runner locally, we want to be able to test S3
submissions. Using the `ASSUME_DEV_IAM_ROLE` flag allows that, but only
when the S3 submissions role in the development environment is also
provided. The role ARN is defined in forms-deploy [[1]], but using it
locally is not well documented.

This commit adds the role ARN to the default configuration for local
development. This should make it possible to test S3 submissions just by
using the `ASSUME_DEV_IAM_ROLE` feature without further configuration.

[1]: https://github.com/govuk-forms/forms-deploy/blob/a12f9395bf84e9e66ea458b396f7867ce4c9f84d/infra/modules/forms-runner/submissions-to-s3.tf#L2
@lfdebrux
lfdebrux force-pushed the ldeb-add-s3-submission-iam-role-arn branch from 418e517 to d2722f7 Compare August 6, 2026 10:15
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

🎉 A review copy of this PR has been deployed! It is made of up two components

  1. A review copy of forms-runner
  2. A production copy of forms-admin

It may take 5 minutes or so for the application to be fully deployed and working. If it still isn't ready
after 5 minutes, there may be something wrong with the ECS task. You will need to go to the integration AWS account
to debug, or otherwise ask an infrastructure person.

For the sign in details and more information, see the review apps wiki page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant