Menu
AWS CodeStar
API Reference (API Version 2017-04-19)

AssociateTeamMember

Adds an IAM user to the team for an AWS CodeStar project.

Request Syntax

{
   "clientRequestToken": "string",
   "projectId": "string",
   "projectRole": "string",
   "remoteAccessAllowed": boolean,
   "userArn": "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.

clientRequestToken

A user- or system-generated token that identifies the entity that requested the team member association to the project. 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

projectId

The ID of the project to which you will add the IAM user.

Type: String

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

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

Required: Yes

projectRole

The AWS CodeStar project role that will apply to this user. This role determines what actions a user can take in an AWS CodeStar project.

Type: String

Pattern: ^(Owner|Viewer|Contributor)$

Required: Yes

remoteAccessAllowed

Whether the team member is allowed to use an SSH public/private key pair to remotely access project resources, for example Amazon EC2 instances.

Type: Boolean

Required: No

userArn

The Amazon Resource Name (ARN) for the IAM user you want to add to the AWS CodeStar project.

Type: String

Length Constraints: Minimum length of 32. Maximum length of 95.

Pattern: ^arn:aws:iam::\d{12}:user(?:(\u002F)|(\u002F[\u0021-\u007E]+\u002F))[\w+=,.@-]+$

Required: Yes

Response Syntax

{
   "clientRequestToken": "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.

clientRequestToken

The user- or system-generated token from the initial request that can be used to repeat the request.

Type: String

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

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

Errors

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

ConcurrentModificationException

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

HTTP Status Code: 400

InvalidServiceRoleException

The service role is not valid.

HTTP Status Code: 400

LimitExceededException

A resource limit has been exceeded.

HTTP Status Code: 400

ProjectConfigurationException

Project configuration information is required but not specified.

HTTP Status Code: 400

ProjectNotFoundException

The specified AWS CodeStar project was not found.

HTTP Status Code: 400

TeamMemberAlreadyAssociatedException

The team member is already associated with a role in this project.

HTTP Status Code: 400

ValidationException

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

HTTP Status Code: 400

Example

Sample Request

POST / HTTP/1.1
Host: codestar.us-east-1.amazonaws.com
Accept-Encoding: identity
Content-Length: 323
X-Amz-Target: CodeStar_20170419.AssociateTeamMember
X-Amz-Date: 20170328T215402Z
User-Agent: aws-cli/1.10.53 Python/2.7.9 Windows/8
Content-Type: application/x-amz-json-1.1
Authorization: AWS4-HMAC-SHA256 Credential=AKIAI44QH8DHBEXAMPLE/20161201/us-east-1/codestar/aws4_request, SignedHeaders=content-type;host;user-agent;x-amz-date;x-amz-target, Signature=8d9b5998EXAMPLE

{
   "Operation": "com.amazonaws.codestar#AssociateTeamMember",
   "Service": "com.amazonaws.codestar#CodeStarService",
   "Input": {
       "projectId": "my-first-projec",
       "projectRole": "Contributor",
       "remoteAccessAllowed": True,
       "userArn": "arn:aws:iam::111111111111:user/Jane_Doe",
    }
}

Sample Response

HTTP/1.1 200 OK
x-amzn-RequestId: 0728aaa8-EXAMPLE
Content-Type: application/x-amz-json-1.1
Content-Length: 2
Date: Tue, 28 March 2017 15:40:24 GMT

{}
         

See Also

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