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.
See the blog about this solution: Launch a standardized DevOps pipeline to deploy containerized applications using AWS Service Catalog
- Create the portfolio using the Launchstack:
- Provision the cluster and codepipeline products from Service Catalog.
- 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. - 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
- clone this git repo:
git clone [email protected]:aws-samples/aws-service-catalog-reference-architectures.git
- 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
- 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
- Set the LinkedRole1 and LinkedRole2 parameters to any additional end user roles you may want to link to the Portfolio.
- Set the CreateEndUsers parameter to No if you have already run a Portfolio stack from this repo (ServiceCatalogEndusers already exists).
- Change the RepoRootURL parameter to your bucket's root url:
https://s3.amazonaws.com/[YOUR-BUCKET-NAME-HERE]/