Skip to content

Resource: awsCodegurureviewerRepositoryAssociation

Terraform resource for managing an AWS CodeGuru Reviewer Repository Association.

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
const awsCodecommitRepositoryExample =
  new aws.codecommitRepository.CodecommitRepository(this, "example", {
    repositoryName: "example-repo",
  });
awsCodecommitRepositoryExample.addOverride("lifecycle", [
  {
    ignore_changes: ['${tags["codeguru-reviewer"]}'],
  },
]);
const awsKmsKeyExample = new aws.kmsKey.KmsKey(this, "example_1", {});
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
awsKmsKeyExample.overrideLogicalId("example");
const awsCodegurureviewerRepositoryAssociationExample =
  new aws.codegurureviewerRepositoryAssociation.CodegurureviewerRepositoryAssociation(
    this,
    "example_2",
    {
      kmsKeyDetails: {
        encryptionOption: "CUSTOMER_MANAGED_CMK",
        kmsKeyId: awsKmsKeyExample.keyId,
      },
      repository: {
        codecommit: {
          name: awsCodecommitRepositoryExample.repositoryName,
        },
      },
    }
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
awsCodegurureviewerRepositoryAssociationExample.overrideLogicalId("example");

Argument Reference

The following arguments are required:

  • repository - (Required) An object describing the repository to associate. Valid values: bitbucket, codecommit, githubEnterpriseServer, or s3Bucket. Block is documented below. Note: for repositories that leverage CodeStar connections (ex. bitbucket, githubEnterpriseServer) the connection must be in available status prior to creating this resource.

The following arguments are optional:

  • kmsKeyDetails - (Optional) An object describing the KMS key to asssociate. Block is documented below.

repository

This configuration block supports the following:

bitbucket

  • connectionArn - (Required) The Amazon Resource Name (ARN) of an AWS CodeStar Connections connection.
  • name - (Required) The name of the third party source repository.
  • owner - (Required) The username for the account that owns the repository.

codecommit

  • name - (Required) The name of the AWS CodeCommit repository.

githubEnterpriseServer

  • connectionArn - (Required) The Amazon Resource Name (ARN) of an AWS CodeStar Connections connection.
  • name - (Required) The name of the third party source repository.
  • owner - (Required) The username for the account that owns the repository.

s3Bucket

  • bucketName - (Required) The name of the S3 bucket used for associating a new S3 repository. Note: The name must begin with codeguruReviewer.
  • name - (Required) The name of the repository in the S3 bucket.

kmsKeyDetails

This configuration block supports the following:

  • encryptionOption - (Optional) The encryption option for a repository association. It is either owned by AWS Key Management Service (KMS) (AWS_OWNED_CMK) or customer managed (CUSTOMER_MANAGED_CMK).
  • kmsKeyId - (Optional) The ID of the AWS KMS key that is associated with a repository association.

Attributes Reference

In addition to all arguments above, the following attributes are exported:

  • arn - The Amazon Resource Name (ARN) identifying the repository association.
  • associationId - The ID of the repository association.
  • connectionArn - The Amazon Resource Name (ARN) of an AWS CodeStar Connections connection.
  • id - The Amazon Resource Name (ARN) identifying the repository association.
  • name - The name of the repository.
  • owner - The owner of the repository.
  • providerType - The provider type of the repository association.
  • state - The state of the repository association.
  • stateReason - A description of why the repository association is in the current state.

Timeouts

Configuration options:

  • create - (Default 60M)
  • update - (Default 180M)
  • delete - (Default 90M)