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

Add fields to the request-an-aws-account tool to so that the new tags are populated on all new accounts #340

Merged
merged 24 commits into from
Jul 3, 2024

Conversation

CorinWilkins
Copy link
Collaborator

@CorinWilkins CorinWilkins commented Jul 2, 2024

Implements Eng-290

  • Modifies the request an account tool flow to require a cost centre code from users requesting new AWS accounts for Cabinet Office.

New screen looks like:
Screenshot 2024-07-02 at 16 27 18

  • Cost centre codes entered by users are checked against data in a csv file downloaded from s3 and stored in tmp
  • The csv file is downloaded from S3 on boot.
  • The s3 bucket is defined by an environment variable.
  • If not present (ie when running locally) a test fixture csv file is used instead.

PR for CO account with cost centre
Screenshot 2024-07-02 at 17 03 37

PR for GPA account without cost centre
Screenshot 2024-07-02 at 17 03 31

CorinWilkins and others added 24 commits June 25, 2024 11:45
Redirect is now supplied by PaaS
Originally put in for billing but now it's not seen as helpful.
Co-authored-by: Hauwa Muhammad  <[email protected]>
- Cost centre is only required for cabinet office and should redirect to summary screen (so user can check answers)
- If cabinet office isn't selected should redirect to team page.
- so users can double check what the code they've entered references.
-varies on whether the org they have chosen is cabinet office or not.
Co-authored-by: Hauwa Muhammad  <[email protected]>
- from s3 if COST_CENTRE_S3_BUCKET_NAME env var set.
- saved to tmp folder which is ignored. Liits possibility of accidentally downloading the data from s3 and commiting it.
- if not set it falls back to use the test fixture file with one fake cost centre.
Read the file into memory rather than writing it to a temp file. AppRunner doesn't make guarantees about local storage, in particular:

> Storage – App Runner automatically scales the instances up or down for your App Runner application in accordance to incoming traffic volume. You can configure Auto scaling options for your App Runner application. Since the number of currently active instances processing the web requests is based on the incoming traffic volume, App Runner **cannot guarantee that the files can persist beyond the processing of a single request**. Hence, App Runner implements the file system in your container instance as ephemeral storage, which entails that the files are transient. For example, the files don't persist when you pause and resume your App Runner service.

[source](https://docs.aws.amazon.com/apprunner/latest/dg/develop.html)

Also changed the initializer so that it parses the CSV file during the initialization sequence. Tweaked the parser class and tests to accept a string rather than filename
Copy link
Contributor

@heathd heathd left a comment

Choose a reason for hiding this comment

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

looks good overall and I've also tested locally

I had one bit of feedback but I've pushed a commit to address that

app/controllers/application_controller.rb Outdated Show resolved Hide resolved
@CorinWilkins CorinWilkins merged commit 0786a62 into main Jul 3, 2024
1 check passed
@CorinWilkins CorinWilkins deleted the eng-290 branch July 3, 2024 07:49
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.

3 participants