DeleteProject - AWS CodeStar


Deletes a project, including project resources. Does not delete users associated with the project, but does delete the IAM roles that allowed access to the project.

Request Syntax

{ "clientRequestToken": "string", "deleteStack": boolean, "id": "string" }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.


A user- or system-generated token that identifies the entity that requested project deletion. This token can be used to repeat the request.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 256.

Pattern: ^[\w:/-]+$

Required: No


Whether to send a delete request for the primary stack in AWS CloudFormation originally used to generate the project and its resources. This option will delete all AWS resources for the project (except for any buckets in Amazon S3) as well as deleting the project itself. Recommended for most use cases.

Type: Boolean

Required: No


The ID of the project to be deleted in AWS CodeStar.

Type: String

Length Constraints: Minimum length of 2. Maximum length of 15.

Pattern: ^[a-z][a-z0-9-]+$

Required: Yes

Response Syntax

{ "projectArn": "string", "stackId": "string" }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.


The Amazon Resource Name (ARN) of the deleted project.

Type: String

Pattern: ^arn:aws[^:\s]*:codestar:[^:\s]+:[0-9]{12}:project\/[a-z]([a-z0-9|-])+$


The ID of the primary stack in AWS CloudFormation that will be deleted as part of deleting the project and its resources.

Type: String

Pattern: ^arn:aws[^:\s]*:cloudformation:[^:\s]+:[0-9]{12}:stack\/[^:\s]+\/[^:\s]+$


For information about the errors that are common to all actions, see Common Errors.


Another modification is being made. That modification must complete before you can make your change.

HTTP Status Code: 400


The service role is not valid.

HTTP Status Code: 400


The specified input is either not valid, or it could not be validated.

HTTP Status Code: 400



This example illustrates one usage of DeleteProject.

Sample Request

POST / HTTP/1.1 Host: Accept-Encoding: identity Content-Length: 24 X-Amz-Target: CodeStar_20170419.DeleteProject X-Amz-Date: 20170405T235449Z User-Agent: aws-cli/1.11.36 Python/2.7.9 Windows/7 botocore/1.4.93 Content-Type: application/x-amz-json-1.1 Authorization: AWS4-HMAC-SHA256 Credential=AIDACKCEVSQ6C2EXAMPLE/20170405/us-east-1/codestar/aws4_request, SignedHeaders=content-type;host;x-amz-date;x-amz-target, Signature=c25ddcd5EXAMPLE {"id": "my-2nd-project"}

Sample Response

HTTP/1.1 200 OK x-amzn-RequestId: 41efcceb-EXAMPLE Content-Type: application/x-amz-json-1.1 Content-Length: 79 Date: Wed, 05 Apr 2017 23:54:51 GMT {"projectArn":"arn:aws:codestar:us-east-1:111111111111:project/my-2nd-project"}

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: