Documentation ¶
Index ¶
- func CfnRepository_CFN_RESOURCE_TYPE_NAME() *string
- func CfnRepository_IsCfnElement(x interface{}) *bool
- func CfnRepository_IsCfnResource(construct constructs.IConstruct) *bool
- func CfnRepository_IsConstruct(x interface{}) *bool
- func NewCfnRepository_Override(c CfnRepository, scope constructs.Construct, id *string, ...)
- func NewCode_Override(c Code)
- func NewRepository_Override(r Repository, scope constructs.Construct, id *string, props *RepositoryProps)
- func ReferenceEvent_CommitId() *string
- func ReferenceEvent_EventType() *string
- func ReferenceEvent_ReferenceFullName() *string
- func ReferenceEvent_ReferenceName() *string
- func ReferenceEvent_ReferenceType() *string
- func ReferenceEvent_RepositoryId() *string
- func ReferenceEvent_RepositoryName() *string
- func Repository_IsConstruct(x interface{}) *bool
- func Repository_IsOwnedResource(construct constructs.IConstruct) *bool
- func Repository_IsResource(construct constructs.IConstruct) *bool
- type CfnRepository
- type CfnRepositoryProps
- type CfnRepository_CodeProperty
- type CfnRepository_RepositoryTriggerProperty
- type CfnRepository_S3Property
- type Code
- type CodeConfig
- type IRepository
- type OnCommitOptions
- type ReferenceEvent
- type Repository
- type RepositoryEventTrigger
- type RepositoryNotificationEvents
- type RepositoryNotifyOnOptions
- type RepositoryProps
- type RepositoryTriggerOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CfnRepository_CFN_RESOURCE_TYPE_NAME ¶
func CfnRepository_CFN_RESOURCE_TYPE_NAME() *string
func CfnRepository_IsCfnElement ¶
func CfnRepository_IsCfnElement(x interface{}) *bool
Returns `true` if a construct is a stack element (i.e. part of the synthesized cloudformation template).
Uses duck-typing instead of `instanceof` to allow stack elements from different versions of this library to be included in the same stack.
Returns: The construct as a stack element or undefined if it is not a stack element.
func CfnRepository_IsCfnResource ¶
func CfnRepository_IsCfnResource(construct constructs.IConstruct) *bool
Check whether the given construct is a CfnResource.
func CfnRepository_IsConstruct ¶
func CfnRepository_IsConstruct(x interface{}) *bool
Checks if `x` is a construct.
Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.
Returns: true if `x` is an object created from a class which extends `Construct`.
func NewCfnRepository_Override ¶
func NewCfnRepository_Override(c CfnRepository, scope constructs.Construct, id *string, props *CfnRepositoryProps)
Create a new `AWS::CodeCommit::Repository`.
func NewCode_Override ¶ added in v2.4.0
func NewCode_Override(c Code)
func NewRepository_Override ¶
func NewRepository_Override(r Repository, scope constructs.Construct, id *string, props *RepositoryProps)
func ReferenceEvent_CommitId ¶
func ReferenceEvent_CommitId() *string
func ReferenceEvent_EventType ¶
func ReferenceEvent_EventType() *string
func ReferenceEvent_ReferenceFullName ¶
func ReferenceEvent_ReferenceFullName() *string
func ReferenceEvent_ReferenceName ¶
func ReferenceEvent_ReferenceName() *string
func ReferenceEvent_ReferenceType ¶
func ReferenceEvent_ReferenceType() *string
func ReferenceEvent_RepositoryId ¶
func ReferenceEvent_RepositoryId() *string
func ReferenceEvent_RepositoryName ¶
func ReferenceEvent_RepositoryName() *string
func Repository_IsConstruct ¶
func Repository_IsConstruct(x interface{}) *bool
Checks if `x` is a construct.
Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.
Returns: true if `x` is an object created from a class which extends `Construct`.
func Repository_IsOwnedResource ¶ added in v2.32.0
func Repository_IsOwnedResource(construct constructs.IConstruct) *bool
Returns true if the construct was created by CDK, and false otherwise.
func Repository_IsResource ¶
func Repository_IsResource(construct constructs.IConstruct) *bool
Check whether the given construct is a Resource.
Types ¶
type CfnRepository ¶
type CfnRepository interface { awscdk.CfnResource awscdk.IInspectable // When you pass the logical ID of this resource, the function returns the Amazon Resource Name (ARN) of the repository. AttrArn() *string // When you pass the logical ID of this resource, the function returns the URL to use for cloning the repository over HTTPS. AttrCloneUrlHttp() *string // When you pass the logical ID of this resource, the function returns the URL to use for cloning the repository over SSH. AttrCloneUrlSsh() *string // When you pass the logical ID of this resource, the function returns the repository's name. AttrName() *string // Options for this resource, such as condition, update policy etc. CfnOptions() awscdk.ICfnResourceOptions CfnProperties() *map[string]interface{} // AWS resource type. CfnResourceType() *string // Information about code to be committed to a repository after it is created in an AWS CloudFormation stack. // // Information about code is only used in resource creation. Updates to a stack will not reflect changes made to code properties after initial resource creation. // // > You can only use this property to add code when creating a repository with a AWS CloudFormation template at creation time. This property cannot be used for updating code to an existing repository. Code() interface{} SetCode(val interface{}) // Returns: the stack trace of the point where this Resource was created from, sourced // from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most // node +internal+ entries filtered. CreationStack() *[]*string // The logical ID for this CloudFormation stack element. // // The logical ID of the element // is calculated from the path of the resource node in the construct tree. // // To override this value, use `overrideLogicalId(newLogicalId)`. // // Returns: the logical ID as a stringified token. This value will only get // resolved during synthesis. LogicalId() *string // The tree node. Node() constructs.Node // Return a string that will be resolved to a CloudFormation `{ Ref }` for this element. // // If, by any chance, the intrinsic reference of a resource is not a string, you could // coerce it to an IResolvable through `Lazy.any({ produce: resource.ref })`. Ref() *string // A comment or description about the new repository. // // > The description field for a repository accepts all HTML characters and all valid Unicode characters. Applications that do not HTML-encode the description and display it in a webpage can expose users to potentially malicious code. Make sure that you HTML-encode the description field in any application that uses this API to display the repository description on a webpage. RepositoryDescription() *string SetRepositoryDescription(val *string) // The name of the new repository to be created. // // > The repository name must be unique across the calling AWS account . Repository names are limited to 100 alphanumeric, dash, and underscore characters, and cannot include certain characters. For more information about the limits on repository names, see [Quotas](https://docs.aws.amazon.com/codecommit/latest/userguide/limits.html) in the *AWS CodeCommit User Guide* . The suffix .git is prohibited. RepositoryName() *string SetRepositoryName(val *string) // The stack in which this element is defined. // // CfnElements must be defined within a stack scope (directly or indirectly). Stack() awscdk.Stack // One or more tag key-value pairs to use when tagging this repository. Tags() awscdk.TagManager // The JSON block of configuration information for each trigger. Triggers() interface{} SetTriggers(val interface{}) // Deprecated. // Deprecated: use `updatedProperties` // // Return properties modified after initiation // // Resources that expose mutable properties should override this function to // collect and return the properties object for this resource. UpdatedProperites() *map[string]interface{} // Return properties modified after initiation. // // Resources that expose mutable properties should override this function to // collect and return the properties object for this resource. UpdatedProperties() *map[string]interface{} // Syntactic sugar for `addOverride(path, undefined)`. AddDeletionOverride(path *string) // Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. // // This can be used for resources across stacks (or nested stack) boundaries // and the dependency will automatically be transferred to the relevant scope. AddDependency(target awscdk.CfnResource) // Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. // Deprecated: use addDependency. AddDependsOn(target awscdk.CfnResource) // Add a value to the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // AddMetadata(key *string, value interface{}) // Adds an override to the synthesized CloudFormation resource. // // To add a // property override, either use `addPropertyOverride` or prefix `path` with // "Properties." (i.e. `Properties.TopicName`). // // If the override is nested, separate each nested level using a dot (.) in the path parameter. // If there is an array as part of the nesting, specify the index in the path. // // To include a literal `.` in the property name, prefix with a `\`. In most // programming languages you will need to write this as `"\\."` because the // `\` itself will need to be escaped. // // For example, // “`typescript // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']); // cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE'); // “` // would add the overrides // “`json // "Properties": { // "GlobalSecondaryIndexes": [ // { // "Projection": { // "NonKeyAttributes": [ "myattribute" ] // ... // } // ... // }, // { // "ProjectionType": "INCLUDE" // ... // }, // ] // ... // } // “` // // The `value` argument to `addOverride` will not be processed or translated // in any way. Pass raw JSON values in here with the correct capitalization // for CloudFormation. If you pass CDK classes or structs, they will be // rendered with lowercased key names, and CloudFormation will reject the // template. AddOverride(path *string, value interface{}) // Adds an override that deletes the value of a property from the resource definition. AddPropertyDeletionOverride(propertyPath *string) // Adds an override to a resource property. // // Syntactic sugar for `addOverride("Properties.<...>", value)`. AddPropertyOverride(propertyPath *string, value interface{}) // Sets the deletion policy of the resource based on the removal policy specified. // // The Removal Policy controls what happens to this resource when it stops // being managed by CloudFormation, either because you've removed it from the // CDK application or because you've made a change that requires the resource // to be replaced. // // The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS // account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). In some // cases, a snapshot can be taken of the resource prior to deletion // (`RemovalPolicy.SNAPSHOT`). A list of resources that support this policy // can be found in the following link:. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html#aws-attribute-deletionpolicy-options // ApplyRemovalPolicy(policy awscdk.RemovalPolicy, options *awscdk.RemovalPolicyOptions) // Returns a token for an runtime attribute of this resource. // // Ideally, use generated attribute accessors (e.g. `resource.arn`), but this can be used for future compatibility // in case there is no generated attribute. GetAtt(attributeName *string, typeHint awscdk.ResolutionTypeHint) awscdk.Reference // Retrieve a value value from the CloudFormation Resource Metadata. // See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html // // Note that this is a different set of metadata from CDK node metadata; this // metadata ends up in the stack template under the resource, whereas CDK // node metadata ends up in the Cloud Assembly. // GetMetadata(key *string) interface{} // Examines the CloudFormation resource and discloses attributes. Inspect(inspector awscdk.TreeInspector) // Retrieves an array of resources this resource depends on. // // This assembles dependencies on resources across stacks (including nested stacks) // automatically. ObtainDependencies() *[]interface{} // Get a shallow copy of dependencies between this resource and other resources in the same stack. ObtainResourceDependencies() *[]awscdk.CfnResource // Overrides the auto-generated logical ID with a specific ID. OverrideLogicalId(newLogicalId *string) // Indicates that this resource no longer depends on another resource. // // This can be used for resources across stacks (including nested stacks) // and the dependency will automatically be removed from the relevant scope. RemoveDependency(target awscdk.CfnResource) RenderProperties(props *map[string]interface{}) *map[string]interface{} // Replaces one dependency with another. ReplaceDependency(target awscdk.CfnResource, newTarget awscdk.CfnResource) // Can be overridden by subclasses to determine if this resource will be rendered into the cloudformation template. // // Returns: `true` if the resource should be included or `false` is the resource // should be omitted. ShouldSynthesize() *bool // Returns a string representation of this construct. // // Returns: a string representation of this resource. ToString() *string ValidateProperties(_properties interface{}) }
A CloudFormation `AWS::CodeCommit::Repository`.
Creates a new, empty repository.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" cfnRepository := awscdk.Aws_codecommit.NewCfnRepository(this, jsii.String("MyCfnRepository"), &CfnRepositoryProps{ RepositoryName: jsii.String("repositoryName"), // the properties below are optional Code: &CodeProperty{ S3: &S3Property{ Bucket: jsii.String("bucket"), Key: jsii.String("key"), // the properties below are optional ObjectVersion: jsii.String("objectVersion"), }, // the properties below are optional BranchName: jsii.String("branchName"), }, RepositoryDescription: jsii.String("repositoryDescription"), Tags: []cfnTag{ &cfnTag{ Key: jsii.String("key"), Value: jsii.String("value"), }, }, Triggers: []interface{}{ &RepositoryTriggerProperty{ DestinationArn: jsii.String("destinationArn"), Events: []*string{ jsii.String("events"), }, Name: jsii.String("name"), // the properties below are optional Branches: []*string{ jsii.String("branches"), }, CustomData: jsii.String("customData"), }, }, })
func NewCfnRepository ¶
func NewCfnRepository(scope constructs.Construct, id *string, props *CfnRepositoryProps) CfnRepository
Create a new `AWS::CodeCommit::Repository`.
type CfnRepositoryProps ¶
type CfnRepositoryProps struct { // The name of the new repository to be created. // // > The repository name must be unique across the calling AWS account . Repository names are limited to 100 alphanumeric, dash, and underscore characters, and cannot include certain characters. For more information about the limits on repository names, see [Quotas](https://docs.aws.amazon.com/codecommit/latest/userguide/limits.html) in the *AWS CodeCommit User Guide* . The suffix .git is prohibited. RepositoryName *string `field:"required" json:"repositoryName" yaml:"repositoryName"` // Information about code to be committed to a repository after it is created in an AWS CloudFormation stack. // // Information about code is only used in resource creation. Updates to a stack will not reflect changes made to code properties after initial resource creation. // // > You can only use this property to add code when creating a repository with a AWS CloudFormation template at creation time. This property cannot be used for updating code to an existing repository. Code interface{} `field:"optional" json:"code" yaml:"code"` // A comment or description about the new repository. // // > The description field for a repository accepts all HTML characters and all valid Unicode characters. Applications that do not HTML-encode the description and display it in a webpage can expose users to potentially malicious code. Make sure that you HTML-encode the description field in any application that uses this API to display the repository description on a webpage. RepositoryDescription *string `field:"optional" json:"repositoryDescription" yaml:"repositoryDescription"` // One or more tag key-value pairs to use when tagging this repository. Tags *[]*awscdk.CfnTag `field:"optional" json:"tags" yaml:"tags"` // The JSON block of configuration information for each trigger. Triggers interface{} `field:"optional" json:"triggers" yaml:"triggers"` }
Properties for defining a `CfnRepository`.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" cfnRepositoryProps := &CfnRepositoryProps{ RepositoryName: jsii.String("repositoryName"), // the properties below are optional Code: &CodeProperty{ S3: &S3Property{ Bucket: jsii.String("bucket"), Key: jsii.String("key"), // the properties below are optional ObjectVersion: jsii.String("objectVersion"), }, // the properties below are optional BranchName: jsii.String("branchName"), }, RepositoryDescription: jsii.String("repositoryDescription"), Tags: []cfnTag{ &cfnTag{ Key: jsii.String("key"), Value: jsii.String("value"), }, }, Triggers: []interface{}{ &RepositoryTriggerProperty{ DestinationArn: jsii.String("destinationArn"), Events: []*string{ jsii.String("events"), }, Name: jsii.String("name"), // the properties below are optional Branches: []*string{ jsii.String("branches"), }, CustomData: jsii.String("customData"), }, }, }
type CfnRepository_CodeProperty ¶
type CfnRepository_CodeProperty struct { // Information about the Amazon S3 bucket that contains a ZIP file of code to be committed to the repository. // // Changes to this property are ignored after initial resource creation. S3 interface{} `field:"required" json:"s3" yaml:"s3"` // Optional. // // Specifies a branch name to be used as the default branch when importing code into a repository on initial creation. If this property is not set, the name *main* will be used for the default branch for the repository. Changes to this property are ignored after initial resource creation. We recommend using this parameter to set the name to *main* to align with the default behavior of CodeCommit unless another name is needed. BranchName *string `field:"optional" json:"branchName" yaml:"branchName"` }
Information about code to be committed.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" codeProperty := &CodeProperty{ S3: &S3Property{ Bucket: jsii.String("bucket"), Key: jsii.String("key"), // the properties below are optional ObjectVersion: jsii.String("objectVersion"), }, // the properties below are optional BranchName: jsii.String("branchName"), }
type CfnRepository_RepositoryTriggerProperty ¶
type CfnRepository_RepositoryTriggerProperty struct { // The ARN of the resource that is the target for a trigger (for example, the ARN of a topic in Amazon SNS). DestinationArn *string `field:"required" json:"destinationArn" yaml:"destinationArn"` // The repository events that cause the trigger to run actions in another service, such as sending a notification through Amazon SNS. // // > The valid value "all" cannot be used with any other values. Events *[]*string `field:"required" json:"events" yaml:"events"` // The name of the trigger. Name *string `field:"required" json:"name" yaml:"name"` // The branches to be included in the trigger configuration. // // If you specify an empty array, the trigger applies to all branches. // // > Although no content is required in the array, you must include the array itself. Branches *[]*string `field:"optional" json:"branches" yaml:"branches"` // Any custom data associated with the trigger to be included in the information sent to the target of the trigger. CustomData *string `field:"optional" json:"customData" yaml:"customData"` }
Information about a trigger for a repository.
> If you want to receive notifications about repository events, consider using notifications instead of triggers. For more information, see [Configuring notifications for repository events](https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-repository-email.html) .
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" repositoryTriggerProperty := &RepositoryTriggerProperty{ DestinationArn: jsii.String("destinationArn"), Events: []*string{ jsii.String("events"), }, Name: jsii.String("name"), // the properties below are optional Branches: []*string{ jsii.String("branches"), }, CustomData: jsii.String("customData"), }
type CfnRepository_S3Property ¶
type CfnRepository_S3Property struct { // The name of the Amazon S3 bucket that contains the ZIP file with the content that will be committed to the new repository. // // This can be specified using the name of the bucket in the AWS account . Changes to this property are ignored after initial resource creation. Bucket *string `field:"required" json:"bucket" yaml:"bucket"` // The key to use for accessing the Amazon S3 bucket. // // Changes to this property are ignored after initial resource creation. For more information, see [Creating object key names](https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html) and [Uploading objects](https://docs.aws.amazon.com/AmazonS3/latest/userguide/upload-objects.html) in the Amazon S3 User Guide. Key *string `field:"required" json:"key" yaml:"key"` // The object version of the ZIP file, if versioning is enabled for the Amazon S3 bucket. // // Changes to this property are ignored after initial resource creation. ObjectVersion *string `field:"optional" json:"objectVersion" yaml:"objectVersion"` }
Information about the Amazon S3 bucket that contains the code that will be committed to the new repository.
Changes to this property are ignored after initial resource creation.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" s3Property := &S3Property{ Bucket: jsii.String("bucket"), Key: jsii.String("key"), // the properties below are optional ObjectVersion: jsii.String("objectVersion"), }
type Code ¶ added in v2.4.0
type Code interface { // This method is called after a repository is passed this instance of Code in its 'code' property. Bind(scope constructs.Construct) *CodeConfig }
Represents the contents to initialize the repository with.
Example:
repo := codecommit.NewRepository(this, jsii.String("Repository"), &RepositoryProps{ RepositoryName: jsii.String("MyRepositoryName"), Code: codecommit.Code_FromDirectory(path.join(__dirname, jsii.String("directory/")), jsii.String("develop")), })
func Code_FromAsset ¶ added in v2.4.0
func Code_FromAsset(asset awss3assets.Asset, branch *string) Code
Code from user-supplied asset.
func Code_FromDirectory ¶ added in v2.4.0
Code from directory.
func Code_FromZipFile ¶ added in v2.4.0
Code from preexisting ZIP file.
type CodeConfig ¶ added in v2.4.0
type CodeConfig struct { // represents the underlying code structure. Code *CfnRepository_CodeProperty `field:"required" json:"code" yaml:"code"` }
Represents the structure to pass into the underlying CfnRepository class.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" codeConfig := &CodeConfig{ Code: &CodeProperty{ S3: &S3Property{ Bucket: jsii.String("bucket"), Key: jsii.String("key"), // the properties below are optional ObjectVersion: jsii.String("objectVersion"), }, // the properties below are optional BranchName: jsii.String("branchName"), }, }
type IRepository ¶
type IRepository interface { awscodestarnotifications.INotificationRuleSource awscdk.IResource // Grant the given principal identity permissions to perform the actions on this repository. Grant(grantee awsiam.IGrantable, actions ...*string) awsiam.Grant // Grant the given identity permissions to pull this repository. GrantPull(grantee awsiam.IGrantable) awsiam.Grant // Grant the given identity permissions to pull and push this repository. GrantPullPush(grantee awsiam.IGrantable) awsiam.Grant // Grant the given identity permissions to read this repository. GrantRead(grantee awsiam.IGrantable) awsiam.Grant // Defines a CodeStar Notification rule triggered when the project events specified by you are emitted. Similar to `onEvent` API. // // You can also use the methods to define rules for the specific event emitted. // eg: `notifyOnPullRequstCreated`. // // Returns: CodeStar Notifications rule associated with this repository. NotifyOn(id *string, target awscodestarnotifications.INotificationRuleTarget, options *RepositoryNotifyOnOptions) awscodestarnotifications.INotificationRule // Defines a CodeStar Notification rule which triggers when an approval rule is overridden. NotifyOnApprovalRuleOverridden(id *string, target awscodestarnotifications.INotificationRuleTarget, options *awscodestarnotifications.NotificationRuleOptions) awscodestarnotifications.INotificationRule // Defines a CodeStar Notification rule which triggers when an approval status is changed. NotifyOnApprovalStatusChanged(id *string, target awscodestarnotifications.INotificationRuleTarget, options *awscodestarnotifications.NotificationRuleOptions) awscodestarnotifications.INotificationRule // Defines a CodeStar Notification rule which triggers when a new branch or tag is created. NotifyOnBranchOrTagCreated(id *string, target awscodestarnotifications.INotificationRuleTarget, options *awscodestarnotifications.NotificationRuleOptions) awscodestarnotifications.INotificationRule // Defines a CodeStar Notification rule which triggers when a branch or tag is deleted. NotifyOnBranchOrTagDeleted(id *string, target awscodestarnotifications.INotificationRuleTarget, options *awscodestarnotifications.NotificationRuleOptions) awscodestarnotifications.INotificationRule // Defines a CodeStar Notification rule which triggers when a comment is made on a pull request. NotifyOnPullRequestComment(id *string, target awscodestarnotifications.INotificationRuleTarget, options *awscodestarnotifications.NotificationRuleOptions) awscodestarnotifications.INotificationRule // Defines a CodeStar Notification rule which triggers when a pull request is created. NotifyOnPullRequestCreated(id *string, target awscodestarnotifications.INotificationRuleTarget, options *awscodestarnotifications.NotificationRuleOptions) awscodestarnotifications.INotificationRule // Defines a CodeStar Notification rule which triggers when a pull request is merged. NotifyOnPullRequestMerged(id *string, target awscodestarnotifications.INotificationRuleTarget, options *awscodestarnotifications.NotificationRuleOptions) awscodestarnotifications.INotificationRule // Defines a CloudWatch event rule which triggers when a comment is made on a commit. OnCommentOnCommit(id *string, options *awsevents.OnEventOptions) awsevents.Rule // Defines a CloudWatch event rule which triggers when a comment is made on a pull request. OnCommentOnPullRequest(id *string, options *awsevents.OnEventOptions) awsevents.Rule // Defines a CloudWatch event rule which triggers when a commit is pushed to a branch. OnCommit(id *string, options *OnCommitOptions) awsevents.Rule // Defines a CloudWatch event rule which triggers for repository events. // // Use // `rule.addEventPattern(pattern)` to specify a filter. OnEvent(id *string, options *awsevents.OnEventOptions) awsevents.Rule // Defines a CloudWatch event rule which triggers when a pull request state is changed. OnPullRequestStateChange(id *string, options *awsevents.OnEventOptions) awsevents.Rule // Defines a CloudWatch event rule which triggers when a reference is created (i.e. a new branch/tag is created) to the repository. OnReferenceCreated(id *string, options *awsevents.OnEventOptions) awsevents.Rule // Defines a CloudWatch event rule which triggers when a reference is delete (i.e. a branch/tag is deleted) from the repository. OnReferenceDeleted(id *string, options *awsevents.OnEventOptions) awsevents.Rule // Defines a CloudWatch event rule which triggers when a reference is updated (i.e. a commit is pushed to an existing or new branch) from the repository. OnReferenceUpdated(id *string, options *awsevents.OnEventOptions) awsevents.Rule // Defines a CloudWatch event rule which triggers when a "CodeCommit Repository State Change" event occurs. OnStateChange(id *string, options *awsevents.OnEventOptions) awsevents.Rule // The ARN of this Repository. RepositoryArn() *string // The HTTPS (GRC) clone URL. // // HTTPS (GRC) is the protocol to use with git-remote-codecommit (GRC). // // It is the recommended method for supporting connections made with federated // access, identity providers, and temporary credentials. // See: https://docs.aws.amazon.com/codecommit/latest/userguide/setting-up-git-remote-codecommit.html // RepositoryCloneUrlGrc() *string // The HTTP clone URL. RepositoryCloneUrlHttp() *string // The SSH clone URL. RepositoryCloneUrlSsh() *string // The human-visible name of this Repository. RepositoryName() *string }
func Repository_FromRepositoryArn ¶
func Repository_FromRepositoryArn(scope constructs.Construct, id *string, repositoryArn *string) IRepository
Imports a codecommit repository.
func Repository_FromRepositoryName ¶
func Repository_FromRepositoryName(scope constructs.Construct, id *string, repositoryName *string) IRepository
type OnCommitOptions ¶
type OnCommitOptions struct { // The scope to use if the source of the rule and its target are in different Stacks (but in the same account & region). // // This helps dealing with cycles that often arise in these situations. CrossStackScope constructs.Construct `field:"optional" json:"crossStackScope" yaml:"crossStackScope"` // A description of the rule's purpose. Description *string `field:"optional" json:"description" yaml:"description"` // Additional restrictions for the event to route to the specified target. // // The method that generates the rule probably imposes some type of event // filtering. The filtering implied by what you pass here is added // on top of that filtering. // See: https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html // EventPattern *awsevents.EventPattern `field:"optional" json:"eventPattern" yaml:"eventPattern"` // A name for the rule. RuleName *string `field:"optional" json:"ruleName" yaml:"ruleName"` // The target to register for the event. Target awsevents.IRuleTarget `field:"optional" json:"target" yaml:"target"` // The branch to monitor. Branches *[]*string `field:"optional" json:"branches" yaml:"branches"` }
Options for the onCommit() method.
Example:
import codecommit "github.com/aws/aws-cdk-go/awscdk" import targets "github.com/aws/aws-cdk-go/awscdk" var repo repository myTopic := sns.NewTopic(this, jsii.String("Topic")) repo.onCommit(jsii.String("OnCommit"), &OnCommitOptions{ Target: targets.NewSnsTopic(myTopic), })
type ReferenceEvent ¶
type ReferenceEvent interface { }
Fields of CloudWatch Events that change references. See: https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/EventTypes.html#codebuild_event_type
type Repository ¶
type Repository interface { awscdk.Resource IRepository // The environment this resource belongs to. // // For resources that are created and managed by the CDK // (generally, those created by creating new class instances like Role, Bucket, etc.), // this is always the same as the environment of the stack they belong to; // however, for imported resources // (those obtained from static methods like fromRoleArn, fromBucketName, etc.), // that might be different than the stack they were imported into. Env() *awscdk.ResourceEnvironment // The tree node. Node() constructs.Node // Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource. // // This value will resolve to one of the following: // - a concrete value (e.g. `"my-awesome-bucket"`) // - `undefined`, when a name should be generated by CloudFormation // - a concrete name generated automatically during synthesis, in // cross-environment scenarios. PhysicalName() *string // The ARN of this Repository. RepositoryArn() *string // The HTTPS (GRC) clone URL. // // HTTPS (GRC) is the protocol to use with git-remote-codecommit (GRC). // // It is the recommended method for supporting connections made with federated // access, identity providers, and temporary credentials. RepositoryCloneUrlGrc() *string // The HTTP clone URL. RepositoryCloneUrlHttp() *string // The SSH clone URL. RepositoryCloneUrlSsh() *string // The human-visible name of this Repository. RepositoryName() *string // The stack in which this resource is defined. Stack() awscdk.Stack // Apply the given removal policy to this resource. // // The Removal Policy controls what happens to this resource when it stops // being managed by CloudFormation, either because you've removed it from the // CDK application or because you've made a change that requires the resource // to be replaced. // // The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS // account for data recovery and cleanup later (`RemovalPolicy.RETAIN`). ApplyRemovalPolicy(policy awscdk.RemovalPolicy) // Returns a source configuration for notification rule. BindAsNotificationRuleSource(_scope constructs.Construct) *awscodestarnotifications.NotificationRuleSourceConfig GeneratePhysicalName() *string // Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`). // // Normally, this token will resolve to `arnAttr`, but if the resource is // referenced across environments, `arnComponents` will be used to synthesize // a concrete ARN with the resource's physical name. Make sure to reference // `this.physicalName` in `arnComponents`. GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string // Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`). // // Normally, this token will resolve to `nameAttr`, but if the resource is // referenced across environments, it will be resolved to `this.physicalName`, // which will be a concrete name. GetResourceNameAttribute(nameAttr *string) *string // Grant the given principal identity permissions to perform the actions on this repository. Grant(grantee awsiam.IGrantable, actions ...*string) awsiam.Grant // Grant the given identity permissions to pull this repository. GrantPull(grantee awsiam.IGrantable) awsiam.Grant // Grant the given identity permissions to pull and push this repository. GrantPullPush(grantee awsiam.IGrantable) awsiam.Grant // Grant the given identity permissions to read this repository. GrantRead(grantee awsiam.IGrantable) awsiam.Grant // Defines a CodeStar Notification rule which triggers when a pull request is merged. NotifiyOnPullRequestMerged(id *string, target awscodestarnotifications.INotificationRuleTarget, options *awscodestarnotifications.NotificationRuleOptions) awscodestarnotifications.INotificationRule // Create a trigger to notify another service to run actions on repository events. Notify(arn *string, options *RepositoryTriggerOptions) Repository // Defines a CodeStar Notification rule triggered when the project events specified by you are emitted. Similar to `onEvent` API. // // You can also use the methods to define rules for the specific event emitted. // eg: `notifyOnPullRequstCreated`. NotifyOn(id *string, target awscodestarnotifications.INotificationRuleTarget, options *RepositoryNotifyOnOptions) awscodestarnotifications.INotificationRule // Defines a CodeStar Notification rule which triggers when an approval rule is overridden. NotifyOnApprovalRuleOverridden(id *string, target awscodestarnotifications.INotificationRuleTarget, options *awscodestarnotifications.NotificationRuleOptions) awscodestarnotifications.INotificationRule // Defines a CodeStar Notification rule which triggers when an approval status is changed. NotifyOnApprovalStatusChanged(id *string, target awscodestarnotifications.INotificationRuleTarget, options *awscodestarnotifications.NotificationRuleOptions) awscodestarnotifications.INotificationRule // Defines a CodeStar Notification rule which triggers when a new branch or tag is created. NotifyOnBranchOrTagCreated(id *string, target awscodestarnotifications.INotificationRuleTarget, options *awscodestarnotifications.NotificationRuleOptions) awscodestarnotifications.INotificationRule // Defines a CodeStar Notification rule which triggers when a branch or tag is deleted. NotifyOnBranchOrTagDeleted(id *string, target awscodestarnotifications.INotificationRuleTarget, options *awscodestarnotifications.NotificationRuleOptions) awscodestarnotifications.INotificationRule // Defines a CodeStar Notification rule which triggers when a comment is made on a pull request. NotifyOnPullRequestComment(id *string, target awscodestarnotifications.INotificationRuleTarget, options *awscodestarnotifications.NotificationRuleOptions) awscodestarnotifications.INotificationRule // Defines a CodeStar Notification rule which triggers when a pull request is created. NotifyOnPullRequestCreated(id *string, target awscodestarnotifications.INotificationRuleTarget, options *awscodestarnotifications.NotificationRuleOptions) awscodestarnotifications.INotificationRule // Defines a CodeStar Notification rule which triggers when a pull request is merged. NotifyOnPullRequestMerged(id *string, target awscodestarnotifications.INotificationRuleTarget, options *awscodestarnotifications.NotificationRuleOptions) awscodestarnotifications.INotificationRule // Defines a CloudWatch event rule which triggers when a comment is made on a commit. OnCommentOnCommit(id *string, options *awsevents.OnEventOptions) awsevents.Rule // Defines a CloudWatch event rule which triggers when a comment is made on a pull request. OnCommentOnPullRequest(id *string, options *awsevents.OnEventOptions) awsevents.Rule // Defines a CloudWatch event rule which triggers when a commit is pushed to a branch. OnCommit(id *string, options *OnCommitOptions) awsevents.Rule // Defines a CloudWatch event rule which triggers for repository events. // // Use // `rule.addEventPattern(pattern)` to specify a filter. OnEvent(id *string, options *awsevents.OnEventOptions) awsevents.Rule // Defines a CloudWatch event rule which triggers when a pull request state is changed. OnPullRequestStateChange(id *string, options *awsevents.OnEventOptions) awsevents.Rule // Defines a CloudWatch event rule which triggers when a reference is created (i.e. a new branch/tag is created) to the repository. OnReferenceCreated(id *string, options *awsevents.OnEventOptions) awsevents.Rule // Defines a CloudWatch event rule which triggers when a reference is delete (i.e. a branch/tag is deleted) from the repository. OnReferenceDeleted(id *string, options *awsevents.OnEventOptions) awsevents.Rule // Defines a CloudWatch event rule which triggers when a reference is updated (i.e. a commit is pushed to an existing or new branch) from the repository. OnReferenceUpdated(id *string, options *awsevents.OnEventOptions) awsevents.Rule // Defines a CloudWatch event rule which triggers when a "CodeCommit Repository State Change" event occurs. OnStateChange(id *string, options *awsevents.OnEventOptions) awsevents.Rule // Returns a string representation of this construct. ToString() *string }
Provides a CodeCommit Repository.
Example:
var project pipelineProject repository := codecommit.NewRepository(this, jsii.String("MyRepository"), &RepositoryProps{ RepositoryName: jsii.String("MyRepository"), }) project := codebuild.NewPipelineProject(this, jsii.String("MyProject")) sourceOutput := codepipeline.NewArtifact() sourceAction := codepipeline_actions.NewCodeCommitSourceAction(&CodeCommitSourceActionProps{ ActionName: jsii.String("CodeCommit"), Repository: Repository, Output: sourceOutput, }) buildAction := codepipeline_actions.NewCodeBuildAction(&CodeBuildActionProps{ ActionName: jsii.String("CodeBuild"), Project: Project, Input: sourceOutput, Outputs: []artifact{ codepipeline.NewArtifact(), }, // optional ExecuteBatchBuild: jsii.Boolean(true), // optional, defaults to false CombineBatchBuildArtifacts: jsii.Boolean(true), }) codepipeline.NewPipeline(this, jsii.String("MyPipeline"), &PipelineProps{ Stages: []stageProps{ &stageProps{ StageName: jsii.String("Source"), Actions: []iAction{ sourceAction, }, }, &stageProps{ StageName: jsii.String("Build"), Actions: []*iAction{ buildAction, }, }, }, })
func NewRepository ¶
func NewRepository(scope constructs.Construct, id *string, props *RepositoryProps) Repository
type RepositoryEventTrigger ¶
type RepositoryEventTrigger string
Repository events that will cause the trigger to run actions in another service.
const ( RepositoryEventTrigger_ALL RepositoryEventTrigger = "ALL" RepositoryEventTrigger_UPDATE_REF RepositoryEventTrigger = "UPDATE_REF" RepositoryEventTrigger_CREATE_REF RepositoryEventTrigger = "CREATE_REF" RepositoryEventTrigger_DELETE_REF RepositoryEventTrigger = "DELETE_REF" )
type RepositoryNotificationEvents ¶
type RepositoryNotificationEvents string
List of event types for AWS CodeCommit. See: https://docs.aws.amazon.com/dtconsole/latest/userguide/concepts.html#events-ref-repositories
const ( // Trigger notication when comment made on commit. RepositoryNotificationEvents_COMMIT_COMMENT RepositoryNotificationEvents = "COMMIT_COMMENT" // Trigger notification when comment made on pull request. RepositoryNotificationEvents_PULL_REQUEST_COMMENT RepositoryNotificationEvents = "PULL_REQUEST_COMMENT" // Trigger notification when approval status changed. RepositoryNotificationEvents_APPROVAL_STATUS_CHANGED RepositoryNotificationEvents = "APPROVAL_STATUS_CHANGED" // Trigger notifications when approval rule is overridden. RepositoryNotificationEvents_APPROVAL_RULE_OVERRIDDEN RepositoryNotificationEvents = "APPROVAL_RULE_OVERRIDDEN" // Trigger notification when pull request created. RepositoryNotificationEvents_PULL_REQUEST_CREATED RepositoryNotificationEvents = "PULL_REQUEST_CREATED" // Trigger notification when pull request source updated. RepositoryNotificationEvents_PULL_REQUEST_SOURCE_UPDATED RepositoryNotificationEvents = "PULL_REQUEST_SOURCE_UPDATED" // Trigger notification when pull request status is changed. RepositoryNotificationEvents_PULL_REQUEST_STATUS_CHANGED RepositoryNotificationEvents = "PULL_REQUEST_STATUS_CHANGED" // Trigger notification when pull requset is merged. RepositoryNotificationEvents_PULL_REQUEST_MERGED RepositoryNotificationEvents = "PULL_REQUEST_MERGED" // Trigger notification when a branch or tag is created. RepositoryNotificationEvents_BRANCH_OR_TAG_CREATED RepositoryNotificationEvents = "BRANCH_OR_TAG_CREATED" // Trigger notification when a branch or tag is deleted. RepositoryNotificationEvents_BRANCH_OR_TAG_DELETED RepositoryNotificationEvents = "BRANCH_OR_TAG_DELETED" // Trigger notification when a branch or tag is updated. RepositoryNotificationEvents_BRANCH_OR_TAG_UPDATED RepositoryNotificationEvents = "BRANCH_OR_TAG_UPDATED" )
type RepositoryNotifyOnOptions ¶
type RepositoryNotifyOnOptions struct { // The level of detail to include in the notifications for this resource. // // BASIC will include only the contents of the event as it would appear in AWS CloudWatch. // FULL will include any supplemental information provided by AWS CodeStar Notifications and/or the service for the resource for which the notification is created. DetailType awscodestarnotifications.DetailType `field:"optional" json:"detailType" yaml:"detailType"` // The status of the notification rule. // // If the enabled is set to DISABLED, notifications aren't sent for the notification rule. Enabled *bool `field:"optional" json:"enabled" yaml:"enabled"` // The name for the notification rule. // // Notification rule names must be unique in your AWS account. NotificationRuleName *string `field:"optional" json:"notificationRuleName" yaml:"notificationRuleName"` // A list of event types associated with this notification rule for CodeCommit repositories. // // For a complete list of event types and IDs, see Notification concepts in the Developer Tools Console User Guide. // See: https://docs.aws.amazon.com/dtconsole/latest/userguide/concepts.html#concepts-api // Events *[]RepositoryNotificationEvents `field:"required" json:"events" yaml:"events"` }
Additional options to pass to the notification rule.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" import "github.com/aws/aws-cdk-go/awscdk" repositoryNotifyOnOptions := &RepositoryNotifyOnOptions{ Events: []repositoryNotificationEvents{ awscdk.Aws_codecommit.*repositoryNotificationEvents_COMMIT_COMMENT, }, // the properties below are optional DetailType: awscdk.Aws_codestarnotifications.DetailType_BASIC, Enabled: jsii.Boolean(false), NotificationRuleName: jsii.String("notificationRuleName"), }
type RepositoryProps ¶
type RepositoryProps struct { // Name of the repository. // // This property is required for all CodeCommit repositories. RepositoryName *string `field:"required" json:"repositoryName" yaml:"repositoryName"` // The contents with which to initialize the repository after it has been created. Code Code `field:"optional" json:"code" yaml:"code"` // A description of the repository. // // Use the description to identify the // purpose of the repository. Description *string `field:"optional" json:"description" yaml:"description"` }
Example:
// Source stage: read from repository repo := codecommit.NewRepository(stack, jsii.String("TemplateRepo"), &RepositoryProps{ RepositoryName: jsii.String("template-repo"), }) sourceOutput := codepipeline.NewArtifact(jsii.String("SourceArtifact")) source := cpactions.NewCodeCommitSourceAction(&CodeCommitSourceActionProps{ ActionName: jsii.String("Source"), Repository: repo, Output: sourceOutput, Trigger: cpactions.CodeCommitTrigger_POLL, }) sourceStage := map[string]interface{}{ "stageName": jsii.String("Source"), "actions": []CodeCommitSourceAction{ source, }, } // Deployment stage: create and deploy changeset with manual approval stackName := "OurStack" changeSetName := "StagedChangeSet" prodStage := map[string]interface{}{ "stageName": jsii.String("Deploy"), "actions": []interface{}{ cpactions.NewCloudFormationCreateReplaceChangeSetAction(&CloudFormationCreateReplaceChangeSetActionProps{ "actionName": jsii.String("PrepareChanges"), "stackName": jsii.String(stackName), "changeSetName": jsii.String(changeSetName), "adminPermissions": jsii.Boolean(true), "templatePath": sourceOutput.atPath(jsii.String("template.yaml")), "runOrder": jsii.Number(1), }), cpactions.NewManualApprovalAction(&ManualApprovalActionProps{ "actionName": jsii.String("ApproveChanges"), "runOrder": jsii.Number(2), }), cpactions.NewCloudFormationExecuteChangeSetAction(&CloudFormationExecuteChangeSetActionProps{ "actionName": jsii.String("ExecuteChanges"), "stackName": jsii.String(stackName), "changeSetName": jsii.String(changeSetName), "runOrder": jsii.Number(3), }), }, } codepipeline.NewPipeline(stack, jsii.String("Pipeline"), &PipelineProps{ Stages: []stageProps{ sourceStage, prodStage, }, })
type RepositoryTriggerOptions ¶
type RepositoryTriggerOptions struct { // The names of the branches in the AWS CodeCommit repository that contain events that you want to include in the trigger. // // If you don't specify at // least one branch, the trigger applies to all branches. Branches *[]*string `field:"optional" json:"branches" yaml:"branches"` // When an event is triggered, additional information that AWS CodeCommit includes when it sends information to the target. CustomData *string `field:"optional" json:"customData" yaml:"customData"` // The repository events for which AWS CodeCommit sends information to the target, which you specified in the DestinationArn property.If you don't specify events, the trigger runs for all repository events. Events *[]RepositoryEventTrigger `field:"optional" json:"events" yaml:"events"` // A name for the trigger.Triggers on a repository must have unique names. Name *string `field:"optional" json:"name" yaml:"name"` }
Creates for a repository trigger to an SNS topic or Lambda function.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import "github.com/aws/aws-cdk-go/awscdk" repositoryTriggerOptions := &RepositoryTriggerOptions{ Branches: []*string{ jsii.String("branches"), }, CustomData: jsii.String("customData"), Events: []repositoryEventTrigger{ awscdk.Aws_codecommit.*repositoryEventTrigger_ALL, }, Name: jsii.String("name"), }
Source Files ¶
- CfnRepository.go
- CfnRepositoryProps.go
- CfnRepository_CodeProperty.go
- CfnRepository_RepositoryTriggerProperty.go
- CfnRepository_S3Property.go
- CfnRepository__checks.go
- Code.go
- CodeConfig.go
- Code__checks.go
- IRepository.go
- IRepository__checks.go
- OnCommitOptions.go
- ReferenceEvent.go
- Repository.go
- RepositoryEventTrigger.go
- RepositoryNotificationEvents.go
- RepositoryNotifyOnOptions.go
- RepositoryProps.go
- RepositoryTriggerOptions.go
- Repository__checks.go
- main.go