Prerequisites for CodeWhisperer customizations - CodeWhisperer

Prerequisites for CodeWhisperer customizations

The CodeWhisperer Customizations feature is in preview, and is subject to change.

CodeWhisperer customizations build upon the foundation of CodeWhisperer Professional, and uses its features.

To use CodeWhisperer customizations you must first follow the CodeWhisperer Professional setup process under Setting up Amazon CodeWhisperer for administrators. This includes adding any users to your CodeWhisperer Professional profile that you also wish to grant access to CodeWhisperer Customizations.

When you use CodeWhisperer Customizations, your CodeWhisperer administrator must be authorized to access your codebase, which you may store on Amazon S3 or through AWS CodeStar. However, during the standard setup process for CodeWhisperer Professional, your AWS Organizations administrator does not provide the CodeWhisperer administrator with access to those services.

Note

If you are using GitHub as your data source, you can restrict usage to certain repositories. See Create a connection to GitHub in the Developer Tools Console User Guide.

Therefore, before you use CodeWhisperer Customizations, you must add the following permissions to your CodeWhisperer administrator's role:

{ "Version": "2012-10-17", "Statement": [{ "Effect": "Allow", "Action": [ "sso-directory:DescribeUsers" ], "Resource": [ "*" ] }, { "Effect": "Allow", "Action": [ "codewhisperer:CreateCustomization", "codewhisperer:DeleteCustomization", "codewhisperer:ListCustomizations", "codewhisperer:UpdateCustomization", "codewhisperer:GetCustomization", "codewhisperer:ListCustomizationPermissions", "codewhisperer:AssociateCustomizationPermission", "codewhisperer:DisassociateCustomizationPermission" ], "Resource": [ "*" ] }, { "Effect": "Allow", "Action": [ "codestar-connections:ListConnections", "codestar-connections:ListOwners", "codestar-connections:ListRepositories", "codestar-connections:GetConnection" ], "Resource": [ "*" ] }, { "Effect": "Allow", "Action": "codestar-connections:UseConnection", "Resource": "*", "Condition": { "ForAnyValue:StringEquals": { "codestar-connections:ProviderAction": [ "GitPull", "ListRepositories", "ListOwners" ] } } }, { "Effect": "Allow", "Action": [ "s3:GetObject*", "s3:GetBucket*", "s3:ListBucket*" ], "Resource": [ "*" ] } ] }

Accessing customization-related messages in Amazon CloudWatch Logs

CodeWhisperer stores information about the creation of your customization in Amazon CloudWatch Logs.

You can authorize your CodeWhisperer administrator to view those logs with the following permission set.

To learn more about the permissions required to delivery logs to multiple resources, see Logging that requires additional permissions [V2] in the Amazon CloudWatch Logs User Guide.

{ "Version": "2012-10-17", "Statement": [ { "Sid": "AllowLogDeliveryActions", "Effect": "Allow", "Action": [ "logs:PutDeliverySource", "logs:GetDeliverySource", "logs:DeleteDeliverySource", "logs:DescribeDeliverySources", "logs:PutDeliveryDestination", "logs:GetDeliveryDestination", "logs:DeleteDeliveryDestination", "logs:DescribeDeliveryDestinations", "logs:CreateDelivery", "logs:GetDelivery", "logs:DeleteDelivery", "logs:DescribeDeliveries", "firehose:ListDeliveryStreams", "firehose:DescribeDeliveryStream", "s3:ListAllMyBuckets", "s3:ListBucket", "s3:GetBucketLocation" ], "Resource": [ "arn:aws:logs:us-east-1:account number:log-group:*", "arn:aws:firehose:us-east-1:account number:deliverystream/*", "arn:aws:s3:::*" ] } ] }

For more information about setting the permissions needed to administer CodeWhisperer Professional, see Assigning CodeWhisperer administration rights.

Note

The encryption key that you set up for CodeWhisperer Professional is also used for CodeWhisperer Customizations.

It's important to create your customization using the best possible source material. When preparing your data source, add code containing patterns that are encouraged on your team. Avoid code containing anti-patterns, bugs, security vulnerabilities, performance issues, and so forth.

Your data source must contain at least 20 MB, and at most 7 GB, of source code files
 from supported languages. There is no limit on the number of files, but you must include at least 10 files for each language that you want your customization to support. In the Amazon S3 data
 source, ensure that all source code is placed within a directory and not at the root
 level. Any files at the root level will be ignored.

Note

CodeWhisperer Customizations supports the following languages and file extensions:

  • Java (.java)

  • JavaScript (.js, .jsx)

  • Python (.py)

  • TypeScript (.ts, .tsx)