1. Packages
  2. AWS
  3. API Docs
  4. codecommit
  5. ApprovalRuleTemplateAssociation
AWS v6.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

aws.codecommit.ApprovalRuleTemplateAssociation

Explore with Pulumi AI

Associates a CodeCommit Approval Rule Template with a Repository.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.codecommit.ApprovalRuleTemplateAssociation("example", {
    approvalRuleTemplateName: exampleAwsCodecommitApprovalRuleTemplate.name,
    repositoryName: exampleAwsCodecommitRepository.repositoryName,
});
Copy
import pulumi
import pulumi_aws as aws

example = aws.codecommit.ApprovalRuleTemplateAssociation("example",
    approval_rule_template_name=example_aws_codecommit_approval_rule_template["name"],
    repository_name=example_aws_codecommit_repository["repositoryName"])
Copy
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/codecommit"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := codecommit.NewApprovalRuleTemplateAssociation(ctx, "example", &codecommit.ApprovalRuleTemplateAssociationArgs{
			ApprovalRuleTemplateName: pulumi.Any(exampleAwsCodecommitApprovalRuleTemplate.Name),
			RepositoryName:           pulumi.Any(exampleAwsCodecommitRepository.RepositoryName),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var example = new Aws.CodeCommit.ApprovalRuleTemplateAssociation("example", new()
    {
        ApprovalRuleTemplateName = exampleAwsCodecommitApprovalRuleTemplate.Name,
        RepositoryName = exampleAwsCodecommitRepository.RepositoryName,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.codecommit.ApprovalRuleTemplateAssociation;
import com.pulumi.aws.codecommit.ApprovalRuleTemplateAssociationArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var example = new ApprovalRuleTemplateAssociation("example", ApprovalRuleTemplateAssociationArgs.builder()
            .approvalRuleTemplateName(exampleAwsCodecommitApprovalRuleTemplate.name())
            .repositoryName(exampleAwsCodecommitRepository.repositoryName())
            .build());

    }
}
Copy
resources:
  example:
    type: aws:codecommit:ApprovalRuleTemplateAssociation
    properties:
      approvalRuleTemplateName: ${exampleAwsCodecommitApprovalRuleTemplate.name}
      repositoryName: ${exampleAwsCodecommitRepository.repositoryName}
Copy

Create ApprovalRuleTemplateAssociation Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new ApprovalRuleTemplateAssociation(name: string, args: ApprovalRuleTemplateAssociationArgs, opts?: CustomResourceOptions);
@overload
def ApprovalRuleTemplateAssociation(resource_name: str,
                                    args: ApprovalRuleTemplateAssociationArgs,
                                    opts: Optional[ResourceOptions] = None)

@overload
def ApprovalRuleTemplateAssociation(resource_name: str,
                                    opts: Optional[ResourceOptions] = None,
                                    approval_rule_template_name: Optional[str] = None,
                                    repository_name: Optional[str] = None)
func NewApprovalRuleTemplateAssociation(ctx *Context, name string, args ApprovalRuleTemplateAssociationArgs, opts ...ResourceOption) (*ApprovalRuleTemplateAssociation, error)
public ApprovalRuleTemplateAssociation(string name, ApprovalRuleTemplateAssociationArgs args, CustomResourceOptions? opts = null)
public ApprovalRuleTemplateAssociation(String name, ApprovalRuleTemplateAssociationArgs args)
public ApprovalRuleTemplateAssociation(String name, ApprovalRuleTemplateAssociationArgs args, CustomResourceOptions options)
type: aws:codecommit:ApprovalRuleTemplateAssociation
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. ApprovalRuleTemplateAssociationArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. ApprovalRuleTemplateAssociationArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. ApprovalRuleTemplateAssociationArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. ApprovalRuleTemplateAssociationArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. ApprovalRuleTemplateAssociationArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var approvalRuleTemplateAssociationResource = new Aws.CodeCommit.ApprovalRuleTemplateAssociation("approvalRuleTemplateAssociationResource", new()
{
    ApprovalRuleTemplateName = "string",
    RepositoryName = "string",
});
Copy
example, err := codecommit.NewApprovalRuleTemplateAssociation(ctx, "approvalRuleTemplateAssociationResource", &codecommit.ApprovalRuleTemplateAssociationArgs{
	ApprovalRuleTemplateName: pulumi.String("string"),
	RepositoryName:           pulumi.String("string"),
})
Copy
var approvalRuleTemplateAssociationResource = new ApprovalRuleTemplateAssociation("approvalRuleTemplateAssociationResource", ApprovalRuleTemplateAssociationArgs.builder()
    .approvalRuleTemplateName("string")
    .repositoryName("string")
    .build());
Copy
approval_rule_template_association_resource = aws.codecommit.ApprovalRuleTemplateAssociation("approvalRuleTemplateAssociationResource",
    approval_rule_template_name="string",
    repository_name="string")
Copy
const approvalRuleTemplateAssociationResource = new aws.codecommit.ApprovalRuleTemplateAssociation("approvalRuleTemplateAssociationResource", {
    approvalRuleTemplateName: "string",
    repositoryName: "string",
});
Copy
type: aws:codecommit:ApprovalRuleTemplateAssociation
properties:
    approvalRuleTemplateName: string
    repositoryName: string
Copy

ApprovalRuleTemplateAssociation Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The ApprovalRuleTemplateAssociation resource accepts the following input properties:

ApprovalRuleTemplateName
This property is required.
Changes to this property will trigger replacement.
string
The name for the approval rule template.
RepositoryName
This property is required.
Changes to this property will trigger replacement.
string
The name of the repository that you want to associate with the template.
ApprovalRuleTemplateName
This property is required.
Changes to this property will trigger replacement.
string
The name for the approval rule template.
RepositoryName
This property is required.
Changes to this property will trigger replacement.
string
The name of the repository that you want to associate with the template.
approvalRuleTemplateName
This property is required.
Changes to this property will trigger replacement.
String
The name for the approval rule template.
repositoryName
This property is required.
Changes to this property will trigger replacement.
String
The name of the repository that you want to associate with the template.
approvalRuleTemplateName
This property is required.
Changes to this property will trigger replacement.
string
The name for the approval rule template.
repositoryName
This property is required.
Changes to this property will trigger replacement.
string
The name of the repository that you want to associate with the template.
approval_rule_template_name
This property is required.
Changes to this property will trigger replacement.
str
The name for the approval rule template.
repository_name
This property is required.
Changes to this property will trigger replacement.
str
The name of the repository that you want to associate with the template.
approvalRuleTemplateName
This property is required.
Changes to this property will trigger replacement.
String
The name for the approval rule template.
repositoryName
This property is required.
Changes to this property will trigger replacement.
String
The name of the repository that you want to associate with the template.

Outputs

All input properties are implicitly available as output properties. Additionally, the ApprovalRuleTemplateAssociation resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing ApprovalRuleTemplateAssociation Resource

Get an existing ApprovalRuleTemplateAssociation resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: ApprovalRuleTemplateAssociationState, opts?: CustomResourceOptions): ApprovalRuleTemplateAssociation
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        approval_rule_template_name: Optional[str] = None,
        repository_name: Optional[str] = None) -> ApprovalRuleTemplateAssociation
func GetApprovalRuleTemplateAssociation(ctx *Context, name string, id IDInput, state *ApprovalRuleTemplateAssociationState, opts ...ResourceOption) (*ApprovalRuleTemplateAssociation, error)
public static ApprovalRuleTemplateAssociation Get(string name, Input<string> id, ApprovalRuleTemplateAssociationState? state, CustomResourceOptions? opts = null)
public static ApprovalRuleTemplateAssociation get(String name, Output<String> id, ApprovalRuleTemplateAssociationState state, CustomResourceOptions options)
resources:  _:    type: aws:codecommit:ApprovalRuleTemplateAssociation    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
ApprovalRuleTemplateName Changes to this property will trigger replacement. string
The name for the approval rule template.
RepositoryName Changes to this property will trigger replacement. string
The name of the repository that you want to associate with the template.
ApprovalRuleTemplateName Changes to this property will trigger replacement. string
The name for the approval rule template.
RepositoryName Changes to this property will trigger replacement. string
The name of the repository that you want to associate with the template.
approvalRuleTemplateName Changes to this property will trigger replacement. String
The name for the approval rule template.
repositoryName Changes to this property will trigger replacement. String
The name of the repository that you want to associate with the template.
approvalRuleTemplateName Changes to this property will trigger replacement. string
The name for the approval rule template.
repositoryName Changes to this property will trigger replacement. string
The name of the repository that you want to associate with the template.
approval_rule_template_name Changes to this property will trigger replacement. str
The name for the approval rule template.
repository_name Changes to this property will trigger replacement. str
The name of the repository that you want to associate with the template.
approvalRuleTemplateName Changes to this property will trigger replacement. String
The name for the approval rule template.
repositoryName Changes to this property will trigger replacement. String
The name of the repository that you want to associate with the template.

Import

Using pulumi import, import CodeCommit approval rule template associations using the approval_rule_template_name and repository_name separated by a comma (,). For example:

$ pulumi import aws:codecommit/approvalRuleTemplateAssociation:ApprovalRuleTemplateAssociation example approver-rule-for-example,MyExampleRepo
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
AWS Classic pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.