AWS CodeStar
User Guide

AWS CodeStar Project Templates

AWS CodeStar project templates allow you to start with a sample application and deploy it using AWS resources created to support your development project. When you choose an AWS CodeStar project template, the application type, programming language, and compute platform are provisioned for you. After you create projects with web applications, web services, Alexa skills, and static web pages, you can replace the sample application with your own.

After AWS CodeStar creates your project, you can modify the AWS resources that support delivery of your application. AWS CodeStar works with AWS CloudFormation to allow you to use code to create support services and servers/serverless platforms in the cloud. AWS CloudFormation allows you to model your entire infrastructure in a text file.

AWS CodeStar Project Files and Resources

An AWS CodeStar project provides a single point of management. You can use the Create project wizard in the console to set up a sample project. You can then use it as a collaboration platform for managing permissions and resources for your team. For more information, see What Is AWS CodeStar?.

When you create a project, AWS CodeStar provisions the following resources:

  • A code repository, either GitHub or AWS CodeCommit, depending on your selection.

  • In the project repository, a README.md file that provides details of files and directories.

  • In the project repository, a template.yml file that stores the definition for your application's runtime stack. You use this file to add or modify project resources.

  • AWS services and resources created in connection with your pipeline, such as the Amazon S3 artifact bucket, Amazon CloudWatch Events, and related service roles.

  • A working sample application with full source code and a public HTTP endpoint.

  • Project roles and associated policies in IAM. Policies are applied automatically to IAM users when you add those users to your project team.

  • An AWS compute resource, based on the AWS CodeStar project template type:

    • A Lambda function (for AWS Lambda-based projects)

    • An Amazon EC2 instance (for EC2-based projects)

    • An AWS Elastic Beanstalk environment (for AWS Elastic Beanstalk-based projects)

The project also includes an interactive dashboard that shows status, links to team management, links to setup instructions for IDEs or your repository, and a commit history of source code changes in the repository. You can also select tools for connecting to external issue tracking tools, such as Jira.

Get Started: Choose a Project Template

Each AWS CodeStar project template consists of an application type, programming language, and compute platform. The combination you select determines the project template.

Choose a Template Application Type

Each template configures one of the following application types:

  • Web service

    A web service is used for tasks that run in the background, such as calling APIs. After AWS CodeStar creates your sample web service project, you can click the endpoint URL to see "Hello World" output, but the primary use of this application type is not as a user interface (UI). The AWS CodeStar project templates in this category supports development in Ruby, Java, ASP.NET, PHP, Node.js, and more.

  • Web application

    A web application features a UI. After AWS CodeStar creates your sample web application project, you can click the endpoint URL to see an interactive web application. The AWS CodeStar project templates in this category support development in Ruby, Java, ASP.NET, PHP, Node.js, and more.

  • Static web page

    Choose this template if you want a project for an HTML website. The AWS CodeStar project templates in this category support development in HTML5.

  • Alexa skill:

    Choose this template if you want a project for an AWS Lambda function based on an Alexa skills blueprint for Amazon Alexa. When you configure your skill in the Alexa Developer Portal, the function returns an Amazon Resource Name (ARN) that you can use as a service endpoint. For more information, see Creating an AWS Lambda Function for a Custom Skill .

    Note

    Lambda functions for Alexa skills are supported in the US East (N. Virginia), EU (Ireland), and Canada (Central) Regions only.

  • Config rule:

    Choose this template if you want a project for an AWS Config rule that lets you automate rules across AWS resources in your account. The function returns an ARN that you can use as a service endpoint for your rule.

Choose a Template Programming Language

When you choose a project template, you select a programming language, such as Ruby, Java, ASP.NET, PHP, Node.js, and more.

Choose a Template Compute Platform

Each template configures one of the following compute platform types:

  • When you choose an AWS Elastic Beanstalk project, you deploy to an AWS Elastic Beanstalk environment on Amazon Elastic Compute Cloud instances in the cloud.

  • When you choose an Amazon EC2 project, AWS CodeStar creates Linux EC2 instances to host your application in the cloud. Your project team members can access the instances, and your team uses the key pair you provide to SSH into your Amazon EC2 instances. AWS CodeStar also has a managed SSH that uses team member permissions to manage key pair connections.

  • When you choose AWS Lambda, AWS CodeStar creates a serverless environment accessed through Amazon API Gateway, with no instances or servers to maintain.

How to Make Changes to Your AWS CodeStar Project

You can update your project by modifying:

  • Sample code and programming language resources for your application.

  • Resources that make up the infrastructure where your application is stored and deployed (operating systems, support applications and services, deployment parameters, and the cloud compute platform). You can modify application resources in the template.yml file. This is the AWS CloudFormation file that models your application's runtime environment.

Change Application Source Code and Push Changes

To modify sample source code, scripts, and other application source files, edit files in your source repository by:

  • Using the Edit mode in AWS CodeCommit or GitHub.

  • Opening the project in an IDE, such as AWS Cloud9.

  • Cloning the repository locally and then committing and pushing your changes. To learn how to do this, see Step 5: Commit a Change.

Change Application Resources with the template.yml File

Instead of manually modifying an infrastructure resource, use AWS CloudFormation to model and deploy your application's runtime resources.

You can modify or add an application resource, such as a Lambda function, in your runtime stack by editing the template.yml file in your project repository. You can add any resource that is available as a AWS CloudFormation resource.

To change the code or settings of an AWS Lambda function, see Add a Resource to a Project.

Modify the template.yml file in your project's repository to add the type of AWS CloudFormation resources that are application resources. When you add an application resource to the Resources section of the template.yml file, AWS CloudFormation and AWS CodeStar create the resource for you. For a list of AWS CloudFormation resources and their required properties, see AWS Resource Types Reference. For more information, see this example in Step 1: Edit the CloudFormation Worker Role in IAM.

AWS CodeStar allows you to implement best practices by configuring and modeling your application's runtime environment.

How to Manage Permissions to Change Application Resources

When you use AWS CloudFormation to add runtime application resources, such as a Lambda function, the AWS CloudFormation worker role can use the permissions it already has. For some runtime application resources, you must manually adjust the AWS CloudFormation worker role's permissions before modifying the template.yml file.

For an example of changing the AWS CloudFormation worker role's permissions, see Step 5: Add Resource Permissions with an Inline Policy.