Skip to content

Latest commit

 

History

History
 
 

AWS Service Catalog ECS Reference architecture

This reference architecture creates an AWS Service Catalog Portfolio called "Service Catalog Containers Reference Architecture"
The Portfolio provides 4 products which will create a full DevOps deployment pipeline from code to container deployment in Fargate.

SC-Devops-ECS.png

HowToVideo

See the blog about this solution: Launch a standardized DevOps pipeline to deploy containerized applications using AWS Service Catalog

  1. Create the portfolio using the Launchstack: CreateStack
  2. Provision the cluster and codepipeline products from Service Catalog.
  3. The provisioned codepipeline product will create a new CodeCommit repo.
    a. Add your code, docker file, and tests.
    a. Adjust the skeleton builspecs in the codepipeline/ subfolder to fit your project tests and build commands.
    b. Check-in the code to the new codecommit repo. CodePipeline will validate, build according to the buildspec files.
    c. If all stages complete then CodePipeline will push the container to ECR.
  4. Once the container is in ECR you can provision the supplied Fargate Service product in Service Catalog.
    This will create an ECS Service which is launched in the previously provisioned Fargate Cluster. You may then view your new service using the ExternalUrl output parameter from the ECS Cluster product.

Be aware, running this service as demonstrated here is non-SSL http. In production you must protect all web traffic with SSL.
The example templates here cannot create and manage SSL for you, so it must be done as an additional task in your account.

For more example ECS tamplates and to see the original source of the provided templates see this repo

Install from your own S3 bucket

  1. clone this git repo:
    git clone [email protected]:aws-samples/aws-service-catalog-reference-architectures.git
  2. Copy everything in the repo to an S3 bucket:
    cd aws-service-catalog-reference-architectures
    aws s3 cp . s3://[YOUR-BUCKET-NAME-HERE] --exclude "*" --include "*.json" --include "*.yml" --recursive
  3. In the AWS CloudFormation console choose "Create Stack" and supply the Portfolio S3 url:
    https://s3.amazonaws.com/[YOUR-BUCKET-NAME-HERE]/ecs/sc-portfolio-ecs.json
  4. Set the LinkedRole1 and LinkedRole2 parameters to any additional end user roles you may want to link to the Portfolio.
  5. Set the CreateEndUsers parameter to No if you have already run a Portfolio stack from this repo (ServiceCatalogEndusers already exists).
  6. Change the RepoRootURL parameter to your bucket's root url:
    https://s3.amazonaws.com/[YOUR-BUCKET-NAME-HERE]/