com.pulumi.aws.codecommit.kotlin.Repository.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.core.Output
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.Deprecated
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.Map
/**
* Builder for [Repository].
*/
@PulumiTagMarker
public class RepositoryResourceBuilder internal constructor() {
public var name: String? = null
public var args: RepositoryArgs = RepositoryArgs()
public var opts: CustomResourceOptions = CustomResourceOptions()
/**
* @param name The _unique_ name of the resulting resource.
*/
public fun name(`value`: String) {
this.name = value
}
/**
* @param block The arguments to use to populate this resource's properties.
*/
public suspend fun args(block: suspend RepositoryArgsBuilder.() -> Unit) {
val builder = RepositoryArgsBuilder()
block(builder)
this.args = builder.build()
}
/**
* @param block A bag of options that control this resource's behavior.
*/
public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
}
internal fun build(): Repository {
val builtJavaResource = com.pulumi.aws.codecommit.Repository(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return Repository(builtJavaResource)
}
}
/**
* Provides a CodeCommit Repository Resource.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
* const test = new aws.codecommit.Repository("test", {
* repositoryName: "MyTestRepository",
* description: "This is the Sample App Repository",
* });
* ```
* ```python
* import pulumi
* import pulumi_aws as aws
* test = aws.codecommit.Repository("test",
* repository_name="MyTestRepository",
* description="This is the Sample App Repository")
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Aws = Pulumi.Aws;
* return await Deployment.RunAsync(() =>
* {
* var test = new Aws.CodeCommit.Repository("test", new()
* {
* RepositoryName = "MyTestRepository",
* Description = "This is the Sample App Repository",
* });
* });
* ```
* ```go
* 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.NewRepository(ctx, "test", &codecommit.RepositoryArgs{
* RepositoryName: pulumi.String("MyTestRepository"),
* Description: pulumi.String("This is the Sample App Repository"),
* })
* 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.Repository;
* import com.pulumi.aws.codecommit.RepositoryArgs;
* 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 test = new Repository("test", RepositoryArgs.builder()
* .repositoryName("MyTestRepository")
* .description("This is the Sample App Repository")
* .build());
* }
* }
* ```
* ```yaml
* resources:
* test:
* type: aws:codecommit:Repository
* properties:
* repositoryName: MyTestRepository
* description: This is the Sample App Repository
* ```
*
* ### AWS KMS Customer Managed Keys (CMK)
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
* const testKey = new aws.kms.Key("test", {
* description: "test",
* deletionWindowInDays: 7,
* });
* const test = new aws.codecommit.Repository("test", {
* repositoryName: "MyTestRepository",
* description: "This is the Sample App Repository",
* kmsKeyId: testKey.arn,
* });
* ```
* ```python
* import pulumi
* import pulumi_aws as aws
* test_key = aws.kms.Key("test",
* description="test",
* deletion_window_in_days=7)
* test = aws.codecommit.Repository("test",
* repository_name="MyTestRepository",
* description="This is the Sample App Repository",
* kms_key_id=test_key.arn)
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Aws = Pulumi.Aws;
* return await Deployment.RunAsync(() =>
* {
* var testKey = new Aws.Kms.Key("test", new()
* {
* Description = "test",
* DeletionWindowInDays = 7,
* });
* var test = new Aws.CodeCommit.Repository("test", new()
* {
* RepositoryName = "MyTestRepository",
* Description = "This is the Sample App Repository",
* KmsKeyId = testKey.Arn,
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/codecommit"
* "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/kms"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* testKey, err := kms.NewKey(ctx, "test", &kms.KeyArgs{
* Description: pulumi.String("test"),
* DeletionWindowInDays: pulumi.Int(7),
* })
* if err != nil {
* return err
* }
* _, err = codecommit.NewRepository(ctx, "test", &codecommit.RepositoryArgs{
* RepositoryName: pulumi.String("MyTestRepository"),
* Description: pulumi.String("This is the Sample App Repository"),
* KmsKeyId: testKey.Arn,
* })
* 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.kms.Key;
* import com.pulumi.aws.kms.KeyArgs;
* import com.pulumi.aws.codecommit.Repository;
* import com.pulumi.aws.codecommit.RepositoryArgs;
* 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 testKey = new Key("testKey", KeyArgs.builder()
* .description("test")
* .deletionWindowInDays(7)
* .build());
* var test = new Repository("test", RepositoryArgs.builder()
* .repositoryName("MyTestRepository")
* .description("This is the Sample App Repository")
* .kmsKeyId(testKey.arn())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* test:
* type: aws:codecommit:Repository
* properties:
* repositoryName: MyTestRepository
* description: This is the Sample App Repository
* kmsKeyId: ${testKey.arn}
* testKey:
* type: aws:kms:Key
* name: test
* properties:
* description: test
* deletionWindowInDays: 7
* ```
*
* ## Import
* Using `pulumi import`, import CodeCommit repository using repository name. For example:
* ```sh
* $ pulumi import aws:codecommit/repository:Repository imported ExistingRepo
* ```
*/
public class Repository internal constructor(
override val javaResource: com.pulumi.aws.codecommit.Repository,
) : KotlinCustomResource(javaResource, RepositoryMapper) {
/**
* The ARN of the repository
*/
public val arn: Output
get() = javaResource.arn().applyValue({ args0 -> args0 })
/**
* The URL to use for cloning the repository over HTTPS.
*/
public val cloneUrlHttp: Output
get() = javaResource.cloneUrlHttp().applyValue({ args0 -> args0 })
/**
* The URL to use for cloning the repository over SSH.
*/
public val cloneUrlSsh: Output
get() = javaResource.cloneUrlSsh().applyValue({ args0 -> args0 })
/**
* The default branch of the repository. The branch specified here needs to exist.
*/
public val defaultBranch: Output?
get() = javaResource.defaultBranch().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The description of the repository. This needs to be less than 1000 characters
*/
public val description: Output?
get() = javaResource.description().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The ARN of the encryption key. If no key is specified, the default `aws/codecommit` Amazon Web Services managed key is used.
*/
public val kmsKeyId: Output
get() = javaResource.kmsKeyId().applyValue({ args0 -> args0 })
/**
* The ID of the repository
*/
public val repositoryId: Output
get() = javaResource.repositoryId().applyValue({ args0 -> args0 })
/**
* The name for the repository. This needs to be less than 100 characters.
*/
public val repositoryName: Output
get() = javaResource.repositoryName().applyValue({ args0 -> args0 })
/**
* Key-value map of resource tags. .If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
*/
public val tags: Output
© 2015 - 2024 Weber Informatics LLC | Privacy Policy