All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.aws.codestarconnections.Connection Maven / Gradle / Ivy

Go to download

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

There is a newer version: 6.72.0
Show newest version
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package com.pulumi.aws.codestarconnections;

import com.pulumi.aws.Utilities;
import com.pulumi.aws.codestarconnections.ConnectionArgs;
import com.pulumi.aws.codestarconnections.inputs.ConnectionState;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import java.lang.String;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * Provides a CodeStar Connection.
 * 
 * > **NOTE:** The `aws.codestarconnections.Connection` resource is created in the state `PENDING`. Authentication with the connection provider must be completed in the AWS Console. See the [AWS documentation](https://docs.aws.amazon.com/dtconsole/latest/userguide/connections-update.html) for details.
 * 
 * ## Example Usage
 * 
 * <!--Start PulumiCodeChooser -->
 * 
 * {@code
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.aws.codestarconnections.Connection;
 * import com.pulumi.aws.codestarconnections.ConnectionArgs;
 * import com.pulumi.aws.codepipeline.Pipeline;
 * import com.pulumi.aws.codepipeline.PipelineArgs;
 * import com.pulumi.aws.codepipeline.inputs.PipelineArtifactStoreArgs;
 * import com.pulumi.aws.codepipeline.inputs.PipelineStageArgs;
 * 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 Connection("example", ConnectionArgs.builder()
 *             .name("example-connection")
 *             .providerType("Bitbucket")
 *             .build());
 * 
 *         var examplePipeline = new Pipeline("examplePipeline", PipelineArgs.builder()
 *             .artifactStores()
 *             .stages(            
 *                 PipelineStageArgs.builder()
 *                     .name("Source")
 *                     .actions(PipelineStageActionArgs.builder()
 *                         .name("Source")
 *                         .category("Source")
 *                         .owner("AWS")
 *                         .provider("CodeStarSourceConnection")
 *                         .version("1")
 *                         .outputArtifacts("source_output")
 *                         .configuration(Map.ofEntries(
 *                             Map.entry("ConnectionArn", example.arn()),
 *                             Map.entry("FullRepositoryId", "my-organization/test"),
 *                             Map.entry("BranchName", "main")
 *                         ))
 *                         .build())
 *                     .build(),
 *                 PipelineStageArgs.builder()
 *                     .actions()
 *                     .name("Build")
 *                     .build(),
 *                 PipelineStageArgs.builder()
 *                     .actions()
 *                     .name("Deploy")
 *                     .build())
 *             .name("tf-test-pipeline")
 *             .roleArn(codepipelineRole.arn())
 *             .build());
 * 
 *     }
 * }
 * }
 * 
* <!--End PulumiCodeChooser --> * * ## Import * * Using `pulumi import`, import CodeStar connections using the ARN. For example: * * ```sh * $ pulumi import aws:codestarconnections/connection:Connection test-connection arn:aws:codestar-connections:us-west-1:0123456789:connection/79d4d357-a2ee-41e4-b350-2fe39ae59448 * ``` * */ @ResourceType(type="aws:codestarconnections/connection:Connection") public class Connection extends com.pulumi.resources.CustomResource { /** * The codestar connection ARN. * */ @Export(name="arn", refs={String.class}, tree="[0]") private Output arn; /** * @return The codestar connection ARN. * */ public Output arn() { return this.arn; } /** * The codestar connection status. Possible values are `PENDING`, `AVAILABLE` and `ERROR`. * */ @Export(name="connectionStatus", refs={String.class}, tree="[0]") private Output connectionStatus; /** * @return The codestar connection status. Possible values are `PENDING`, `AVAILABLE` and `ERROR`. * */ public Output connectionStatus() { return this.connectionStatus; } /** * The Amazon Resource Name (ARN) of the host associated with the connection. Conflicts with `provider_type` * */ @Export(name="hostArn", refs={String.class}, tree="[0]") private Output hostArn; /** * @return The Amazon Resource Name (ARN) of the host associated with the connection. Conflicts with `provider_type` * */ public Output> hostArn() { return Codegen.optional(this.hostArn); } /** * The name of the connection to be created. The name must be unique in the calling AWS account. Changing `name` will create a new resource. * */ @Export(name="name", refs={String.class}, tree="[0]") private Output name; /** * @return The name of the connection to be created. The name must be unique in the calling AWS account. Changing `name` will create a new resource. * */ public Output name() { return this.name; } /** * The name of the external provider where your third-party code repository is configured. Valid values are `Bitbucket`, `GitHub`, `GitHubEnterpriseServer`, `GitLab` or `GitLabSelfManaged`. Changing `provider_type` will create a new resource. Conflicts with `host_arn` * */ @Export(name="providerType", refs={String.class}, tree="[0]") private Output providerType; /** * @return The name of the external provider where your third-party code repository is configured. Valid values are `Bitbucket`, `GitHub`, `GitHubEnterpriseServer`, `GitLab` or `GitLabSelfManaged`. Changing `provider_type` will create a new resource. Conflicts with `host_arn` * */ public Output providerType() { return this.providerType; } /** * Map of key-value resource tags to associate with the resource. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. * */ @Export(name="tags", refs={Map.class,String.class}, tree="[0,1,1]") private Output> tags; /** * @return Map of key-value resource tags to associate with the resource. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. * */ public Output>> tags() { return Codegen.optional(this.tags); } /** * A map of tags assigned to the resource, including those inherited from the provider `default_tags` configuration block. * * @deprecated * Please use `tags` instead. * */ @Deprecated /* Please use `tags` instead. */ @Export(name="tagsAll", refs={Map.class,String.class}, tree="[0,1,1]") private Output> tagsAll; /** * @return A map of tags assigned to the resource, including those inherited from the provider `default_tags` configuration block. * */ public Output> tagsAll() { return this.tagsAll; } /** * * @param name The _unique_ name of the resulting resource. */ public Connection(java.lang.String name) { this(name, ConnectionArgs.Empty); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. */ public Connection(java.lang.String name, @Nullable ConnectionArgs args) { this(name, args, null); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. * @param options A bag of options that control this resource's behavior. */ public Connection(java.lang.String name, @Nullable ConnectionArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("aws:codestarconnections/connection:Connection", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false); } private Connection(java.lang.String name, Output id, @Nullable ConnectionState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("aws:codestarconnections/connection:Connection", name, state, makeResourceOptions(options, id), false); } private static ConnectionArgs makeArgs(@Nullable ConnectionArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { if (options != null && options.getUrn().isPresent()) { return null; } return args == null ? ConnectionArgs.Empty : args; } private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output id) { var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder() .version(Utilities.getVersion()) .build(); return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id); } /** * Get an existing Host resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state * @param options Optional settings to control the behavior of the CustomResource. */ public static Connection get(java.lang.String name, Output id, @Nullable ConnectionState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { return new Connection(name, id, state, options); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy