Try AWS Native preview for resources not in the classic version.
aws.codecommit.ApprovalRuleTemplate
Explore with Pulumi AI
Try AWS Native preview for resources not in the classic version.
Provides a CodeCommit Approval Rule Template Resource.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.codecommit.ApprovalRuleTemplate("example", {
name: "MyExampleApprovalRuleTemplate",
description: "This is an example approval rule template",
content: JSON.stringify({
Version: "2018-11-08",
DestinationReferences: ["refs/heads/master"],
Statements: [{
Type: "Approvers",
NumberOfApprovalsNeeded: 2,
ApprovalPoolMembers: ["arn:aws:sts::123456789012:assumed-role/CodeCommitReview/*"],
}],
}),
});
import pulumi
import json
import pulumi_aws as aws
example = aws.codecommit.ApprovalRuleTemplate("example",
name="MyExampleApprovalRuleTemplate",
description="This is an example approval rule template",
content=json.dumps({
"Version": "2018-11-08",
"DestinationReferences": ["refs/heads/master"],
"Statements": [{
"Type": "Approvers",
"NumberOfApprovalsNeeded": 2,
"ApprovalPoolMembers": ["arn:aws:sts::123456789012:assumed-role/CodeCommitReview/*"],
}],
}))
package main
import (
"encoding/json"
"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 {
tmpJSON0, err := json.Marshal(map[string]interface{}{
"Version": "2018-11-08",
"DestinationReferences": []string{
"refs/heads/master",
},
"Statements": []map[string]interface{}{
map[string]interface{}{
"Type": "Approvers",
"NumberOfApprovalsNeeded": 2,
"ApprovalPoolMembers": []string{
"arn:aws:sts::123456789012:assumed-role/CodeCommitReview/*",
},
},
},
})
if err != nil {
return err
}
json0 := string(tmpJSON0)
_, err = codecommit.NewApprovalRuleTemplate(ctx, "example", &codecommit.ApprovalRuleTemplateArgs{
Name: pulumi.String("MyExampleApprovalRuleTemplate"),
Description: pulumi.String("This is an example approval rule template"),
Content: pulumi.String(json0),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.CodeCommit.ApprovalRuleTemplate("example", new()
{
Name = "MyExampleApprovalRuleTemplate",
Description = "This is an example approval rule template",
Content = JsonSerializer.Serialize(new Dictionary<string, object?>
{
["Version"] = "2018-11-08",
["DestinationReferences"] = new[]
{
"refs/heads/master",
},
["Statements"] = new[]
{
new Dictionary<string, object?>
{
["Type"] = "Approvers",
["NumberOfApprovalsNeeded"] = 2,
["ApprovalPoolMembers"] = new[]
{
"arn:aws:sts::123456789012:assumed-role/CodeCommitReview/*",
},
},
},
}),
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.codecommit.ApprovalRuleTemplate;
import com.pulumi.aws.codecommit.ApprovalRuleTemplateArgs;
import static com.pulumi.codegen.internal.Serialization.*;
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 ApprovalRuleTemplate("example", ApprovalRuleTemplateArgs.builder()
.name("MyExampleApprovalRuleTemplate")
.description("This is an example approval rule template")
.content(serializeJson(
jsonObject(
jsonProperty("Version", "2018-11-08"),
jsonProperty("DestinationReferences", jsonArray("refs/heads/master")),
jsonProperty("Statements", jsonArray(jsonObject(
jsonProperty("Type", "Approvers"),
jsonProperty("NumberOfApprovalsNeeded", 2),
jsonProperty("ApprovalPoolMembers", jsonArray("arn:aws:sts::123456789012:assumed-role/CodeCommitReview/*"))
)))
)))
.build());
}
}
resources:
example:
type: aws:codecommit:ApprovalRuleTemplate
properties:
name: MyExampleApprovalRuleTemplate
description: This is an example approval rule template
content:
fn::toJSON:
Version: 2018-11-08
DestinationReferences:
- refs/heads/master
Statements:
- Type: Approvers
NumberOfApprovalsNeeded: 2
ApprovalPoolMembers:
- arn:aws:sts::123456789012:assumed-role/CodeCommitReview/*
Create ApprovalRuleTemplate Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ApprovalRuleTemplate(name: string, args: ApprovalRuleTemplateArgs, opts?: CustomResourceOptions);
@overload
def ApprovalRuleTemplate(resource_name: str,
args: ApprovalRuleTemplateArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ApprovalRuleTemplate(resource_name: str,
opts: Optional[ResourceOptions] = None,
content: Optional[str] = None,
description: Optional[str] = None,
name: Optional[str] = None)
func NewApprovalRuleTemplate(ctx *Context, name string, args ApprovalRuleTemplateArgs, opts ...ResourceOption) (*ApprovalRuleTemplate, error)
public ApprovalRuleTemplate(string name, ApprovalRuleTemplateArgs args, CustomResourceOptions? opts = null)
public ApprovalRuleTemplate(String name, ApprovalRuleTemplateArgs args)
public ApprovalRuleTemplate(String name, ApprovalRuleTemplateArgs args, CustomResourceOptions options)
type: aws:codecommit:ApprovalRuleTemplate
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args ApprovalRuleTemplateArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args ApprovalRuleTemplateArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args ApprovalRuleTemplateArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ApprovalRuleTemplateArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ApprovalRuleTemplateArgs
- 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 approvalRuleTemplateResource = new Aws.CodeCommit.ApprovalRuleTemplate("approvalRuleTemplateResource", new()
{
Content = "string",
Description = "string",
Name = "string",
});
example, err := codecommit.NewApprovalRuleTemplate(ctx, "approvalRuleTemplateResource", &codecommit.ApprovalRuleTemplateArgs{
Content: pulumi.String("string"),
Description: pulumi.String("string"),
Name: pulumi.String("string"),
})
var approvalRuleTemplateResource = new ApprovalRuleTemplate("approvalRuleTemplateResource", ApprovalRuleTemplateArgs.builder()
.content("string")
.description("string")
.name("string")
.build());
approval_rule_template_resource = aws.codecommit.ApprovalRuleTemplate("approvalRuleTemplateResource",
content="string",
description="string",
name="string")
const approvalRuleTemplateResource = new aws.codecommit.ApprovalRuleTemplate("approvalRuleTemplateResource", {
content: "string",
description: "string",
name: "string",
});
type: aws:codecommit:ApprovalRuleTemplate
properties:
content: string
description: string
name: string
ApprovalRuleTemplate Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The ApprovalRuleTemplate resource accepts the following input properties:
- Content string
- The content of the approval rule template. Maximum of 3000 characters.
- Description string
- The description of the approval rule template. Maximum of 1000 characters.
- Name string
- The name for the approval rule template. Maximum of 100 characters.
- Content string
- The content of the approval rule template. Maximum of 3000 characters.
- Description string
- The description of the approval rule template. Maximum of 1000 characters.
- Name string
- The name for the approval rule template. Maximum of 100 characters.
- content String
- The content of the approval rule template. Maximum of 3000 characters.
- description String
- The description of the approval rule template. Maximum of 1000 characters.
- name String
- The name for the approval rule template. Maximum of 100 characters.
- content string
- The content of the approval rule template. Maximum of 3000 characters.
- description string
- The description of the approval rule template. Maximum of 1000 characters.
- name string
- The name for the approval rule template. Maximum of 100 characters.
- content str
- The content of the approval rule template. Maximum of 3000 characters.
- description str
- The description of the approval rule template. Maximum of 1000 characters.
- name str
- The name for the approval rule template. Maximum of 100 characters.
- content String
- The content of the approval rule template. Maximum of 3000 characters.
- description String
- The description of the approval rule template. Maximum of 1000 characters.
- name String
- The name for the approval rule template. Maximum of 100 characters.
Outputs
All input properties are implicitly available as output properties. Additionally, the ApprovalRuleTemplate resource produces the following output properties:
- Approval
Rule stringTemplate Id - The ID of the approval rule template
- Creation
Date string - The date the approval rule template was created, in RFC3339 format.
- Id string
- The provider-assigned unique ID for this managed resource.
- Last
Modified stringDate - The date the approval rule template was most recently changed, in RFC3339 format.
- Last
Modified stringUser - The Amazon Resource Name (ARN) of the user who made the most recent changes to the approval rule template.
- Rule
Content stringSha256 - The SHA-256 hash signature for the content of the approval rule template.
- Approval
Rule stringTemplate Id - The ID of the approval rule template
- Creation
Date string - The date the approval rule template was created, in RFC3339 format.
- Id string
- The provider-assigned unique ID for this managed resource.
- Last
Modified stringDate - The date the approval rule template was most recently changed, in RFC3339 format.
- Last
Modified stringUser - The Amazon Resource Name (ARN) of the user who made the most recent changes to the approval rule template.
- Rule
Content stringSha256 - The SHA-256 hash signature for the content of the approval rule template.
- approval
Rule StringTemplate Id - The ID of the approval rule template
- creation
Date String - The date the approval rule template was created, in RFC3339 format.
- id String
- The provider-assigned unique ID for this managed resource.
- last
Modified StringDate - The date the approval rule template was most recently changed, in RFC3339 format.
- last
Modified StringUser - The Amazon Resource Name (ARN) of the user who made the most recent changes to the approval rule template.
- rule
Content StringSha256 - The SHA-256 hash signature for the content of the approval rule template.
- approval
Rule stringTemplate Id - The ID of the approval rule template
- creation
Date string - The date the approval rule template was created, in RFC3339 format.
- id string
- The provider-assigned unique ID for this managed resource.
- last
Modified stringDate - The date the approval rule template was most recently changed, in RFC3339 format.
- last
Modified stringUser - The Amazon Resource Name (ARN) of the user who made the most recent changes to the approval rule template.
- rule
Content stringSha256 - The SHA-256 hash signature for the content of the approval rule template.
- approval_
rule_ strtemplate_ id - The ID of the approval rule template
- creation_
date str - The date the approval rule template was created, in RFC3339 format.
- id str
- The provider-assigned unique ID for this managed resource.
- last_
modified_ strdate - The date the approval rule template was most recently changed, in RFC3339 format.
- last_
modified_ struser - The Amazon Resource Name (ARN) of the user who made the most recent changes to the approval rule template.
- rule_
content_ strsha256 - The SHA-256 hash signature for the content of the approval rule template.
- approval
Rule StringTemplate Id - The ID of the approval rule template
- creation
Date String - The date the approval rule template was created, in RFC3339 format.
- id String
- The provider-assigned unique ID for this managed resource.
- last
Modified StringDate - The date the approval rule template was most recently changed, in RFC3339 format.
- last
Modified StringUser - The Amazon Resource Name (ARN) of the user who made the most recent changes to the approval rule template.
- rule
Content StringSha256 - The SHA-256 hash signature for the content of the approval rule template.
Look up Existing ApprovalRuleTemplate Resource
Get an existing ApprovalRuleTemplate 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?: ApprovalRuleTemplateState, opts?: CustomResourceOptions): ApprovalRuleTemplate
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
approval_rule_template_id: Optional[str] = None,
content: Optional[str] = None,
creation_date: Optional[str] = None,
description: Optional[str] = None,
last_modified_date: Optional[str] = None,
last_modified_user: Optional[str] = None,
name: Optional[str] = None,
rule_content_sha256: Optional[str] = None) -> ApprovalRuleTemplate
func GetApprovalRuleTemplate(ctx *Context, name string, id IDInput, state *ApprovalRuleTemplateState, opts ...ResourceOption) (*ApprovalRuleTemplate, error)
public static ApprovalRuleTemplate Get(string name, Input<string> id, ApprovalRuleTemplateState? state, CustomResourceOptions? opts = null)
public static ApprovalRuleTemplate get(String name, Output<String> id, ApprovalRuleTemplateState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- 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.
- Approval
Rule stringTemplate Id - The ID of the approval rule template
- Content string
- The content of the approval rule template. Maximum of 3000 characters.
- Creation
Date string - The date the approval rule template was created, in RFC3339 format.
- Description string
- The description of the approval rule template. Maximum of 1000 characters.
- Last
Modified stringDate - The date the approval rule template was most recently changed, in RFC3339 format.
- Last
Modified stringUser - The Amazon Resource Name (ARN) of the user who made the most recent changes to the approval rule template.
- Name string
- The name for the approval rule template. Maximum of 100 characters.
- Rule
Content stringSha256 - The SHA-256 hash signature for the content of the approval rule template.
- Approval
Rule stringTemplate Id - The ID of the approval rule template
- Content string
- The content of the approval rule template. Maximum of 3000 characters.
- Creation
Date string - The date the approval rule template was created, in RFC3339 format.
- Description string
- The description of the approval rule template. Maximum of 1000 characters.
- Last
Modified stringDate - The date the approval rule template was most recently changed, in RFC3339 format.
- Last
Modified stringUser - The Amazon Resource Name (ARN) of the user who made the most recent changes to the approval rule template.
- Name string
- The name for the approval rule template. Maximum of 100 characters.
- Rule
Content stringSha256 - The SHA-256 hash signature for the content of the approval rule template.
- approval
Rule StringTemplate Id - The ID of the approval rule template
- content String
- The content of the approval rule template. Maximum of 3000 characters.
- creation
Date String - The date the approval rule template was created, in RFC3339 format.
- description String
- The description of the approval rule template. Maximum of 1000 characters.
- last
Modified StringDate - The date the approval rule template was most recently changed, in RFC3339 format.
- last
Modified StringUser - The Amazon Resource Name (ARN) of the user who made the most recent changes to the approval rule template.
- name String
- The name for the approval rule template. Maximum of 100 characters.
- rule
Content StringSha256 - The SHA-256 hash signature for the content of the approval rule template.
- approval
Rule stringTemplate Id - The ID of the approval rule template
- content string
- The content of the approval rule template. Maximum of 3000 characters.
- creation
Date string - The date the approval rule template was created, in RFC3339 format.
- description string
- The description of the approval rule template. Maximum of 1000 characters.
- last
Modified stringDate - The date the approval rule template was most recently changed, in RFC3339 format.
- last
Modified stringUser - The Amazon Resource Name (ARN) of the user who made the most recent changes to the approval rule template.
- name string
- The name for the approval rule template. Maximum of 100 characters.
- rule
Content stringSha256 - The SHA-256 hash signature for the content of the approval rule template.
- approval_
rule_ strtemplate_ id - The ID of the approval rule template
- content str
- The content of the approval rule template. Maximum of 3000 characters.
- creation_
date str - The date the approval rule template was created, in RFC3339 format.
- description str
- The description of the approval rule template. Maximum of 1000 characters.
- last_
modified_ strdate - The date the approval rule template was most recently changed, in RFC3339 format.
- last_
modified_ struser - The Amazon Resource Name (ARN) of the user who made the most recent changes to the approval rule template.
- name str
- The name for the approval rule template. Maximum of 100 characters.
- rule_
content_ strsha256 - The SHA-256 hash signature for the content of the approval rule template.
- approval
Rule StringTemplate Id - The ID of the approval rule template
- content String
- The content of the approval rule template. Maximum of 3000 characters.
- creation
Date String - The date the approval rule template was created, in RFC3339 format.
- description String
- The description of the approval rule template. Maximum of 1000 characters.
- last
Modified StringDate - The date the approval rule template was most recently changed, in RFC3339 format.
- last
Modified StringUser - The Amazon Resource Name (ARN) of the user who made the most recent changes to the approval rule template.
- name String
- The name for the approval rule template. Maximum of 100 characters.
- rule
Content StringSha256 - The SHA-256 hash signature for the content of the approval rule template.
Import
Using pulumi import
, import CodeCommit approval rule templates using the name
. For example:
$ pulumi import aws:codecommit/approvalRuleTemplate:ApprovalRuleTemplate imported ExistingApprovalRuleTemplateName
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.
Try AWS Native preview for resources not in the classic version.