com.pulumi.aws.codecommit.kotlin.ApprovalRuleTemplateArgs.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-aws-kotlin Show documentation
Show all versions of pulumi-aws-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.aws.codecommit.kotlin
import com.pulumi.aws.codecommit.ApprovalRuleTemplateArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName
/**
* Provides a CodeCommit Approval Rule Template Resource.
* ## Example Usage
*
* ```typescript
* 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/*"],
* }],
* }),
* });
* ```
* ```python
* 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/*"],
* }],
* }))
* ```
* ```csharp
* 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
* {
* ["Version"] = "2018-11-08",
* ["DestinationReferences"] = new[]
* {
* "refs/heads/master",
* },
* ["Statements"] = new[]
* {
* new Dictionary
* {
* ["Type"] = "Approvers",
* ["NumberOfApprovalsNeeded"] = 2,
* ["ApprovalPoolMembers"] = new[]
* {
* "arn:aws:sts::123456789012:assumed-role/CodeCommitReview/*",
* },
* },
* },
* }),
* });
* });
* ```
* ```go
* 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
* })
* }
* ```
* ```java
* 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());
* }
* }
* ```
* ```yaml
* 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/*
* ```
*
* ## Import
* Using `pulumi import`, import CodeCommit approval rule templates using the `name`. For example:
* ```sh
* $ pulumi import aws:codecommit/approvalRuleTemplate:ApprovalRuleTemplate imported ExistingApprovalRuleTemplateName
* ```
* @property content The content of the approval rule template. Maximum of 3000 characters.
* @property description The description of the approval rule template. Maximum of 1000 characters.
* @property name The name for the approval rule template. Maximum of 100 characters.
* */*/*/*/*/*/
*/
public data class ApprovalRuleTemplateArgs(
public val content: Output? = null,
public val description: Output? = null,
public val name: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.aws.codecommit.ApprovalRuleTemplateArgs =
com.pulumi.aws.codecommit.ApprovalRuleTemplateArgs.builder()
.content(content?.applyValue({ args0 -> args0 }))
.description(description?.applyValue({ args0 -> args0 }))
.name(name?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [ApprovalRuleTemplateArgs].
*/
@PulumiTagMarker
public class ApprovalRuleTemplateArgsBuilder internal constructor() {
private var content: Output? = null
private var description: Output? = null
private var name: Output? = null
/**
* @param value The content of the approval rule template. Maximum of 3000 characters.
*/
@JvmName("cdrrkxmurrbwaskd")
public suspend fun content(`value`: Output) {
this.content = value
}
/**
* @param value The description of the approval rule template. Maximum of 1000 characters.
*/
@JvmName("ypchystsiymkmeoh")
public suspend fun description(`value`: Output) {
this.description = value
}
/**
* @param value The name for the approval rule template. Maximum of 100 characters.
*/
@JvmName("vuavtjnuihxpermx")
public suspend fun name(`value`: Output) {
this.name = value
}
/**
* @param value The content of the approval rule template. Maximum of 3000 characters.
*/
@JvmName("kyfvfngwskvrrfqp")
public suspend fun content(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.content = mapped
}
/**
* @param value The description of the approval rule template. Maximum of 1000 characters.
*/
@JvmName("mqlknmyeyjieycfl")
public suspend fun description(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.description = mapped
}
/**
* @param value The name for the approval rule template. Maximum of 100 characters.
*/
@JvmName("jjbcyrgynqdgbnaw")
public suspend fun name(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.name = mapped
}
internal fun build(): ApprovalRuleTemplateArgs = ApprovalRuleTemplateArgs(
content = content,
description = description,
name = name,
)
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy