create_project

create_project(**kwargs)

Creates a project, including project resources. This action creates a project based on a submitted project request. A set of source code files and a toolchain template file can be included with the project request. If these are not provided, an empty project is created.

See also: AWS API Documentation

Request Syntax

response = client.create_project(
    name='string',
    id='string',
    description='string',
    clientRequestToken='string',
    sourceCode=[
        {
            'source': {
                's3': {
                    'bucketName': 'string',
                    'bucketKey': 'string'
                }
            },
            'destination': {
                'codeCommit': {
                    'name': 'string'
                },
                'gitHub': {
                    'name': 'string',
                    'description': 'string',
                    'type': 'string',
                    'owner': 'string',
                    'privateRepository': True|False,
                    'issuesEnabled': True|False,
                    'token': 'string'
                }
            }
        },
    ],
    toolchain={
        'source': {
            's3': {
                'bucketName': 'string',
                'bucketKey': 'string'
            }
        },
        'roleArn': 'string',
        'stackParameters': {
            'string': 'string'
        }
    },
    tags={
        'string': 'string'
    }
)
Parameters
  • name (string) --

    [REQUIRED]

    The display name for the project to be created in AWS CodeStar.

  • id (string) --

    [REQUIRED]

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

  • description (string) -- The description of the project, if any.
  • clientRequestToken (string) -- A user- or system-generated token that identifies the entity that requested project creation. This token can be used to repeat the request.
  • sourceCode (list) --

    A list of the Code objects submitted with the project request. If this parameter is specified, the request must also include the toolchain parameter.

    • (dict) --

      Location and destination information about the source code files provided with the project request. The source code is uploaded to the new project source repository after project creation.

      • source (dict) -- [REQUIRED]

        The location where the source code files provided with the project request are stored. AWS CodeStar retrieves the files during project creation.

        • s3 (dict) -- [REQUIRED]

          Information about the Amazon S3 location where the source code files provided with the project request are stored.

          • bucketName (string) --

            The Amazon S3 bucket name where the source code files provided with the project request are stored.

          • bucketKey (string) --

            The Amazon S3 object key where the source code files provided with the project request are stored.

      • destination (dict) -- [REQUIRED]

        The repository to be created in AWS CodeStar. Valid values are AWS CodeCommit or GitHub. After AWS CodeStar provisions the new repository, the source code files provided with the project request are placed in the repository.

        • codeCommit (dict) --

          Information about the AWS CodeCommit repository to be created in AWS CodeStar. This is where the source code files provided with the project request will be uploaded after project creation.

          • name (string) -- [REQUIRED]

            The name of the AWS CodeCommit repository to be created in AWS CodeStar.

        • gitHub (dict) --

          Information about the GitHub repository to be created in AWS CodeStar. This is where the source code files provided with the project request will be uploaded after project creation.

          • name (string) -- [REQUIRED]

            Name of the GitHub repository to be created in AWS CodeStar.

          • description (string) --

            Description for the GitHub repository to be created in AWS CodeStar. This description displays in GitHub after the repository is created.

          • type (string) -- [REQUIRED]

            The type of GitHub repository to be created in AWS CodeStar. Valid values are User or Organization.

          • owner (string) -- [REQUIRED]

            The GitHub username for the owner of the GitHub repository to be created in AWS CodeStar. If this repository should be owned by a GitHub organization, provide its name.

          • privateRepository (boolean) -- [REQUIRED]

            Whether the GitHub repository is to be a private repository.

          • issuesEnabled (boolean) -- [REQUIRED]

            Whether to enable issues for the GitHub repository.

          • token (string) -- [REQUIRED]

            The GitHub user's personal access token for the GitHub repository.

  • toolchain (dict) --

    The name of the toolchain template file submitted with the project request. If this parameter is specified, the request must also include the sourceCode parameter.

    • source (dict) -- [REQUIRED]

      The Amazon S3 location where the toolchain template file provided with the project request is stored. AWS CodeStar retrieves the file during project creation.

      • s3 (dict) -- [REQUIRED]

        The Amazon S3 bucket where the toolchain template file provided with the project request is stored.

        • bucketName (string) --

          The Amazon S3 bucket name where the source code files provided with the project request are stored.

        • bucketKey (string) --

          The Amazon S3 object key where the source code files provided with the project request are stored.

    • roleArn (string) --

      The service role ARN for AWS CodeStar to use for the toolchain template during stack provisioning.

    • stackParameters (dict) --

      The list of parameter overrides to be passed into the toolchain template during stack provisioning, if any.

      • (string) --
        • (string) --
  • tags (dict) --

    The tags created for the project.

    • (string) --
      • (string) --
Return type

dict

Returns

Response Syntax

{
    'id': 'string',
    'arn': 'string',
    'clientRequestToken': 'string',
    'projectTemplateId': 'string'
}

Response Structure

  • (dict) --

    • id (string) --

      The ID of the project.

    • arn (string) --

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

    • clientRequestToken (string) --

      A user- or system-generated token that identifies the entity that requested project creation.

    • projectTemplateId (string) --

      Reserved for future use.

Exceptions

  • CodeStar.Client.exceptions.ProjectAlreadyExistsException
  • CodeStar.Client.exceptions.LimitExceededException
  • CodeStar.Client.exceptions.ValidationException
  • CodeStar.Client.exceptions.ProjectCreationFailedException
  • CodeStar.Client.exceptions.InvalidServiceRoleException
  • CodeStar.Client.exceptions.ProjectConfigurationException
  • CodeStar.Client.exceptions.ConcurrentModificationException