{"id":27998213,"url":"https://github.com/alphagov/re-request-an-aws-account","last_synced_at":"2025-05-08T22:50:59.414Z","repository":{"id":33684034,"uuid":"130889355","full_name":"alphagov/re-request-an-aws-account","owner":"alphagov","description":":partly_sunny: An interface for requesting AWS accounts","archived":false,"fork":false,"pushed_at":"2025-04-23T12:28:02.000Z","size":727,"stargazers_count":1,"open_issues_count":13,"forks_count":1,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-04-23T12:29:38.640Z","etag":null,"topics":["accounts-deployment","cross-gds","engineering-enablement"],"latest_commit_sha":null,"homepage":"https://request-an-aws-account.gds-reliability.engineering/","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alphagov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-04-24T17:18:36.000Z","updated_at":"2025-04-23T12:28:04.000Z","dependencies_parsed_at":"2024-05-01T04:25:12.436Z","dependency_job_id":"8ee90bde-c3cf-4e8f-b202-95ed8abff177","html_url":"https://github.com/alphagov/re-request-an-aws-account","commit_stats":null,"previous_names":[],"tags_count":44,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alphagov%2Fre-request-an-aws-account","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alphagov%2Fre-request-an-aws-account/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alphagov%2Fre-request-an-aws-account/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alphagov%2Fre-request-an-aws-account/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alphagov","download_url":"https://codeload.github.com/alphagov/re-request-an-aws-account/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253160827,"owners_count":21863624,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["accounts-deployment","cross-gds","engineering-enablement"],"created_at":"2025-05-08T22:50:58.596Z","updated_at":"2025-05-08T22:50:59.408Z","avatar_url":"https://github.com/alphagov.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"Engineering Enablement: Request an AWS Account\n===============================================\n\nUser interface to manage AWS Accounts (e.g. for new services or environments) and users within the base AWS account.\n\nRunning locally\n---------------\n\nThis is a rails app, with dependencies managed by bundler. To run the app locally clone this repo, then:\n\n```sh\nbundle install\nnpm install\nbundle exec rails server\n```\n\nIf you want to test the apps interaction with third party services (e.g. GitHub\nand GOV.UK Notify) you'll need to set up some secrets in environment variables.\nThe easiest way to do this in development is using a `.env` file (see [.env.example](.env.example)):\n\n```sh\ncp .env.example .env\n$EDITOR .env\n```\n\nRun the tests with:\n\n```sh\nbundle exec rails test\n```\n\nTo sign in as a development user, visit \u003chttp://localhost:3000/dev-login\u003e (to try different email addresses, you can provide a `email` parameter). If you want to test with real Google SSO, you can [create an application in the Google Cloud Console](https://console.developers.google.com/apis/credentials).\n\n\nBuilding Docker Image\n--------------------\n\nNote - when building the docker image on a mac arm but wanting to run the image on x86 architecture then run the `docker build` with this flag: `--platform=\"linux/amd64\"`\n\nRuby App Master Key\n-------------------\n\nIf running in production a master key is required to decrypt `credentials.yml.enc`. This has been created and is passed into the container/environment at runtime.\n\n\nENV vars\n--------\n\n  - `RAILS_ALLOWED_DOMAINS`: the domain of the app runtime env (eg loalhost:3000 or sub.domain.tld)\n  - `RAILS_SERVE_STATIC_FILES` true|false(default)\n  - `RAILS_LOG_TO_STDOUT` true : will log out errors etc since production defaults to logfile\n  - `RESTRICT_LOGIN_EMAIL_ADDRESSES_TO`: `example.one@digital.cabinet-office.gov.uk example.two@digital.cabinet-office.gov.uk` - should be a space separated list of email addresses if set it will only allow those email address to log in\n\n\nENV secrets\n-----------\n\n  - `GOOGLE_CLIENT_ID`: an OAuth2 client ID\n  - `GOOGLE_CLIENT_SECRET`: an OAuth2 client secret\n  - `GITHUB_PERSONAL_ACCESS_TOKEN`: the PAT required to act on requied alphagov repos\n  - `NOTIFY_API_KEY`: a key to use the notify api to send emails\n  - `RAILS_MASTER_KEY`: the key that has been used to encode `config/credentials.yml.enc`\n\nUpdating the Cost Centre Information\n-----------\n\nWe have a csv file in S3 which contains the Cabinet Office cost centre information. This is used to check the cost centre details entered by the user when requesting an AWS account. The original source for cost centre information in the intranet is updated monthly and we should replace the file in out S3 bucket periodically with the most up to date version.\n\nYou will need to be on the VPN both to access the file on the intranet, and to upload to to S3. \n\nDownload the Cost Center Hierarchy CSV file available on [this Cabinet Office intranet page](https://intranet.cabinetoffice.gov.uk/managing-people-and-services/corporate-services-directory/cdt-information-hub/co-reporting/cabinet-office-cost-centres/).\n\nRun the CSV Updater script from the root of the project with:\n```sh\ngds aws \u003caccount-name\u003e -- bundle exec ruby bin/csv_updater -b \"\u003cbucket-name\u003e\" -f \"\u003cpath-to-file\u003e\"\n```\nFor test environment:\n- Account name: ```ee-request-aws-account-test-admin```\n- Bucket name: ```gds-ee-raat-test-csv```\n\nProduction environment:\n- Account name: ```ee-request-aws-account-prod```\n- Bucket name: ```gds-ee-raat-prod-csv```\n\nPath to file is the absolute path of the file eg: ```/Users/myusername/Downloads/cost_centres.csv```.\n\nThe script checks that the headers in the CSV have the expected values. If the upload fails because the headers have been changed, you need to update the keys accordingly in the ```mapping``` hash in the ```/bin/csv_updater``` file, leaving the values in the hash as they are (the examples shown in comments in the mapping give an idea of the format of the data in each column - this is to help identify which columns are needed if the headers have changed.)  \n\n**Important note:** The csv file should not be made public, so if you save it inside the project, ensure you delete it after running the script and DO NOT push it to GitHub. \n\n**To apply the changes, you must restart the app.** \nLogin to the AWS account by running: ```gds aws \u003caccount-name\u003e -l```.\nIn the AWS console, open App Runner and click the orange deploy button to refresh the instance without downtime.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falphagov%2Fre-request-an-aws-account","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falphagov%2Fre-request-an-aws-account","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falphagov%2Fre-request-an-aws-account/lists"}