Skip to content

A service for maintaining and securely sharing information on top tier companies

License

Notifications You must be signed in to change notification settings

uktrade/strategic-companies-list

Repository files navigation

Strategic Companies List logo

Strategic Companies List

A service for maintaining and securely sharing information on top tier companies


Contents


Running locally

docker compose down && docker compose up --build

Visit http://localhost:8000/

Provisioning infrastructure

Important

The instructions below use Terraform to provision the infrastructure for Strategic Companies List, the "entry-point" of which is an internet-facing Application Load Balancer (ALB). However, it is assumed this ALB is the origin of a CloudFront distribution, but this CloudFront distribution, as well as the DNS records for it and the ABL, are currently not defined in the Terraform, and so must be provisioned separately. While potentially awkard when setting up each environment, it allows for flexibility. For example, they can be setup in another AWS account by other users.

In future versions it is possible that the CloudFront distribution and DNS records are provisioned using the Terraform in this repository.

AWS infrastructure for running the strategic-companies-list is defined through Terraform in infra/, although each environment (dev, prod, etc) needs manual bootstrapping. There are various options, but one possibility:

  1. Create or get access to an AWS account for running the infrastructure.

  2. Install the AWS CLI if you don't have it already.

  3. Create an AWS profile configured for the AWS CLI, for example my-profile-name. See the the AWS Cli documentation for more details.

  4. For each environment, create an S3 bucket of any name (for storing the Terraform state file).

  5. For each environment, create a DynamoDB table of any name, and with a a string LockID partition key (for storing a lock that prevents multiple changes to infrastructure at once).

  6. For each environment, create a directory outside of a cloned copy of this repository. A typical file layout would be the following.

     any-folder
       ├── stategic-companies-list (a cloned copy of this repository)
       └── stategic-companies-list-deploy
           ├── dev
           └── prod
    
  7. In each environment directory, create a main.tf as follows, replacing the <...>`` patterns with the S3 bucket name, DynamoDB table, and environment name, and populating the module` with additional variables defined in infra/variables.tf

    terraform {
      backend "s3" {
        region         = "eu-west-2"
        encrypt        = true
        bucket         = "<bucket)name>"
        key            = "<environment_name>.tfstate"
        dynamodb_table = "<dynamodb_table_name>"
      }
    }
    
    provider "aws" {
      region = "eu-west-2"
    }
    
    module "strategic_companies_list" {
      source = "../../strategic-companies-list/infra"
    }
    
    output "strategic_companies_list" {
      value     = module.strategic_companies_list
      sensitive = true
    }
  8. If you configured AWS CLI though SSO access, run:

    AWS_PROFILE=my-profile-name aws sso login
  9. In each new environment's directory run

    AWS_PROFILE=my-profile-name terraform init

    and then

    AWS_PROFILE=my-profile-name terraform apply
  10. (Optional) Use direnv to avoid having to use AWS_PROFILE=my-profile-name for future terraform commands.

Licenses and attributions

The code of Strategic Companies List is licensed under the MIT License.

However, the Secure Companies List logo is not licensed in the MIT License: it is a modified version of Nursila's strategy icon, purchased via a Noun project subscription.

About

A service for maintaining and securely sharing information on top tier companies

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published