GithubHelp home page GithubHelp logo

aws-samples / aws-proton-cloudformation-sample-templates Goto Github PK

View Code? Open in Web Editor NEW
270.0 20.0 419.0 5.25 MB

Sample templates for AWS Proton

Home Page: https://aws.amazon.com/proton

License: MIT No Attribution

aws-proton-cloudformation-sample-templates's Introduction

AWS Proton Sample CloudFormation Templates

This repository is a curated list of sample templates to use within AWS Proton that are authored for integration with AWS CloudFormation.

To use this repository, browse to the folder that corresponds to the template that you want to use. You will find there:

  • An architecture description of the template
  • A list of all the parameters required for the template
  • The full content of a template, ready to be registered into AWS Proton
  • A spec directory with an example spec file spec.yaml that you can use to create an environment or a service from the example template.
  • A link to a repository with basic code that runs on each of the templates, in case you want to fork it to use it as the basis for your deployment. The basic code is hosted in the AWS Proton sample services repository

If you are looking for sample templates to use Terraform go to our AWS Proton Terraform sample templates library

Registering Templates Using Template Sync

All of the Templates in this directory are set up to work with AWS Proton Template Sync. This repository is also a Github Template Repository. So you can click "Use this template" on the home page of this repo and that will create an identical repo in your account, which you can then use with template sync.

Security

See CONTRIBUTING for more information.

License

This library is licensed under the MIT-0 License. See the LICENSE file.

aws-proton-cloudformation-sample-templates's People

Contributors

abhivr-amazon avatar adamjkeller avatar amazon-auto avatar awishn02 avatar clareliguori avatar dankhen avatar gamecock avatar henrybravo avatar jiahuitao avatar jritsema avatar knizami avatar kohidave avatar lloydchang avatar mikewrighton avatar mrletourneau avatar nouvionp avatar pamelakuang avatar piradeepk avatar pjambet avatar racicot-amzn avatar rafavallina avatar realvz avatar setttings avatar stevepotter avatar syedsaadahmed1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aws-proton-cloudformation-sample-templates's Issues

update tar command in the readme

first, thank you for this helpful repository! :) i'm learning a lot from it.

last commit #60 changed directory structure without updating readme file
in tar commands paths need to reflect the updated folder structure "microservices-xxx"

for example:
'tar -zcvf env-template.tar.gz environment/' => 'tar -zcvf env-template.tar.gz microservices-env/'

ps. i wonder if 'readme.md' can be generated or referenced through dynamic relative paths

When attempting to deploy service Deployment fails.

Following the lambda-multi-svc example

the command
aws proton get-service --region us-west-2 --name "tasks-front-end"

returns a failure
"deploymentStatus": "FAILED", "deploymentStatusMessage": "[/Resources/FunctionBucket/Type/BucketEncryption/ServerSideEncryptionConfiguration/0/ServerSideEncryptionByDefault] 'null' values are not allowed in templates",
"deploymentStatus": "FAILED",
"deploymentStatusMessage": "Service Instance(s): [arn:aws:proton:us-west-2:609826415497:service/tasks-front-end/service-instance/front-end] failed to deploy - canceling pipeline deployment",
`

I updated the svc-spec.yaml file to include a code_uri property becuase it was listed in the schema, but had no idea what value to give it. That changed the failure message to:

`

Service template schema is not valid: Missing property [pipelineInputType]

When running the following command:

aws proton-preview create-service-template-minor-version \
  --region us-west-2 \
  --template-name "lb-fargate-service" \
  --description "Version 1" \
  --major-version-id "1" \
  --source-s3-bucket proton-cli-templates-${account_id} \
  --source-s3-key svc-template.tar.gz

I get an error in the console saying that registration of the template failed due to Missing property [pipelineInputType].

I've documented the steps that I've taken here: https://github.com/relaxdiego/aws-cf-ebs/tree/main/proton

S3 and CloudFront Templates

What is the teams opinion on deploying static sites to S3 and CloudFront via proton.

While it doesn't fit the paradigm of Containers or Lambda, i don't see any technical limitations from the service / CF side.

I think environments, may get weird, for example is the S3 bucket and cloudfront distro the environment?

Curious to know if this has come up. Currently building a workshop leveraging proton and we were thinking about this as one of the sections. If the team agrees happy to provide a working template.

Error in Pipeline deployment

I guess wrong commit in 3d4224c.

I think the following is correct on line 74 of file public-private-fargate-microservices/service/loadbalanced-public-svc/pipeline/cloudformation.yaml.

"aws proton-preview --endpoint-url https://proton.$AWS_DEFAULT_REGION.amazonaws.com --region $AWS_DEFAULT_REGION get-service --service-name $service_name | jq -r .service.spec > service.yaml",

Add Sample for .NET Framework with Windows CI/CD Pipeline

Given that .NET Framework is a common application framework in legacy enterprise applications an example of leveraging Proton for such a use case would be valuable.

As enterprise customers with .NET Framework applications look to migrate their workloads to AWS, Proton provides organizations with platform teams with the means necessary to enforce standards and yet provide application teams to stand up their environments, deploy their applications, and setup a CI/CD pipeline with the necessary flexibility.

fail to provision an environment in another account

Following the guide to create environment in one account and provision in another account, running below command to provision environment across account with error,

aws proton create-environment \
  --region us-west-2 \
  --name "multi-svc-beta" \
  --template-name multi-svc-env \
  --template-major-version 1 \
  --environment-account-connection-id ${environment_account_connection_id} \
  --spec file://specs/env-spec.yaml

An error occurred (ValidationException) when calling the CreateEnvironment operation: Idempotent parameter mismatch

Any idea how to resolve it?

use --query instead of jq

In the README.md there is a command you used : account_id=aws sts get-caller-identity|jq -r ".Account"

This means that you have to add jq into the machine which is not necessary, you can get the same result by using --query Account -

account_id=aws sts get-caller-identity --query Account --output text

Permissions for CodePipeline

When following the Proton Multi-Service Template, the last step fails because pipeline roles have not been configured. Do the permissions need to be added to my User or the Proton role? Which permissions are needed?

$ aws proton create-service --region us-west-2 --name "tasks-front-end" --repository-connection-arn arn:aws:codestar-connections:us-west-2:${account_id}:connection/<your-codestar-connection-id> --repository-id "<your-source-repo-account>/<your-repository-name>" --branch "main" --template-major-version 1 --template-name crud-api-service --spec file://specs/svc-spec.yaml

when credentials are filled in generates:
An error occurred (ValidationException) when calling the CreateService operation: Operation cannot be run until pipeline roles have been configured

Documentation minor issue when creating the private service

https://github.com/aws-samples/aws-proton-sample-templates/tree/main/public-private-fargate-microservices

In the below snippet, need to rename from lb-private-fargate-svc to private-fargate-svc

aws proton-preview create-service \ --region us-east-2 \ --service-name "back-end" \ --repository-connection-arn arn:aws:codestar-connections:us-east-2:${account_id}:connection/<your-codestar-connection-id> \ --repository-id "<your-source-repo-account>/<your-repository-name>" \ --branch "main" \ --template-major-version-id 1 \ --service-template-arn arn:aws:proton:us-east-2:${account_id}:service-template/lb-private-fargate-svc \ --spec file://specs/svc-private-spec.yaml

Template Deployment Status stays Draft

When following the Proton Multi-Service Template, the template status shows DRAFT.

Wait for the environment template version to be successfully registered. You can try this command to see the registration status

aws proton get-environment-template-version
--region us-west-2
--template-name "multi-svc-env"
--major-version "1"
--minor-version "0"

If the wait is ignored and you just proceed with the PUBLISH everything works. The same happens on the service templates. I've narrowed it down to one of 3 issues:

  1. There is no need to wait-> If this is true I can submit a PR to remove those instructions.
  2. There is a problem with the CLI, I am using aws-cli/2.2.18 Python/3.8.8 Windows/10 exe/AMD64 prompt/off
  3. There is a problem with the API.

Error in. pipeline while trying the public private load balancer template

Hi, I'm trying to use the public private loadbalancer template, but when tried aws cli was on 1.9.x where the aws proton is not executing , hence updated the aws cli to latest, now which is failing for this command

aws proton --endpoint-url https://proton.$AWS_DEFAULT_REGION.amazonaws.com --region $AWS_DEFAULT_REGION update-service-instance --deployment-type CURRENT_VERSION --name $service_instance_name --service-name $service_name --spec file://./rendered_service.yaml

Below is the log

[Container] 2021/06/22 07:57:06 Running command aws --version
981 | aws-cli/2.2.13 Python/3.8.8 Linux/4.14.225-121.362.amzn1.x86_64 exec-env/AWS_ECS_EC2 exe/x86_64.amzn.2 prompt/off
982 |  
983 | [Container] 2021/06/22 07:57:07 Running command ls
984 | aws
985 | awscliv2.zip
986 | rendered_service.yaml
987 |  
988 | [Container] 2021/06/22 07:57:07 Running command cat rendered_service.yaml
989 | instances: {}
990 |  
991 | [Container] 2021/06/22 07:57:07 Running command aws proton --endpoint-url https://proton.$AWS_DEFAULT_REGION.amazonaws.com --region $AWS_DEFAULT_REGION update-service-instance --deployment-type CURRENT_VERSION --name $service_instance_name --service-name $service_name --spec file://./rendered_service.yaml
992 |  
993 | An error occurred (ValidationException) when calling the UpdateServiceInstance operation: Spec parsing failed Cannot deserialize instance of java.util.ArrayList<com.amazonaws.arrow.patterncommon.model.ServiceInstance> out of START_OBJECT token
994


Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.