// *** 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.directconnect;

import com.pulumi.aws.Utilities;
import com.pulumi.aws.directconnect.ConnectionAssociationArgs;
import com.pulumi.aws.directconnect.inputs.ConnectionAssociationState;
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 javax.annotation.Nullable;

/**
 * Associates a Direct Connect Connection with a LAG.
 * 
 * ## Example Usage
 * ```java
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.aws.directconnect.Connection;
 * import com.pulumi.aws.directconnect.ConnectionArgs;
 * import com.pulumi.aws.directconnect.LinkAggregationGroup;
 * import com.pulumi.aws.directconnect.LinkAggregationGroupArgs;
 * import com.pulumi.aws.directconnect.ConnectionAssociation;
 * import com.pulumi.aws.directconnect.ConnectionAssociationArgs;
 * 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 exampleConnection = new Connection(&#34;exampleConnection&#34;, ConnectionArgs.builder()        
 *             .bandwidth(&#34;1Gbps&#34;)
 *             .location(&#34;EqSe2-EQ&#34;)
 *             .build());
 * 
 *         var exampleLinkAggregationGroup = new LinkAggregationGroup(&#34;exampleLinkAggregationGroup&#34;, LinkAggregationGroupArgs.builder()        
 *             .connectionsBandwidth(&#34;1Gbps&#34;)
 *             .location(&#34;EqSe2-EQ&#34;)
 *             .build());
 * 
 *         var exampleConnectionAssociation = new ConnectionAssociation(&#34;exampleConnectionAssociation&#34;, ConnectionAssociationArgs.builder()        
 *             .connectionId(exampleConnection.id())
 *             .lagId(exampleLinkAggregationGroup.id())
 *             .build());
 * 
 *     }
 * }
 * ```
 * 
 */
@ResourceType(type="aws:directconnect/connectionAssociation:ConnectionAssociation")
public class ConnectionAssociation extends com.pulumi.resources.CustomResource {
    /**
     * The ID of the connection.
     * 
     */
    @Export(name="connectionId", refs={String.class}, tree="[0]")
    private Output<String> connectionId;

    /**
     * @return The ID of the connection.
     * 
     */
    public Output<String> connectionId() {
        return this.connectionId;
    }
    /**
     * The ID of the LAG with which to associate the connection.
     * 
     */
    @Export(name="lagId", refs={String.class}, tree="[0]")
    private Output<String> lagId;

    /**
     * @return The ID of the LAG with which to associate the connection.
     * 
     */
    public Output<String> lagId() {
        return this.lagId;
    }

    /**
     *
     * @param name The _unique_ name of the resulting resource.
     */
    public ConnectionAssociation(String name) {
        this(name, ConnectionAssociationArgs.Empty);
    }
    /**
     *
     * @param name The _unique_ name of the resulting resource.
     * @param args The arguments to use to populate this resource's properties.
     */
    public ConnectionAssociation(String name, ConnectionAssociationArgs 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 ConnectionAssociation(String name, ConnectionAssociationArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("aws:directconnect/connectionAssociation:ConnectionAssociation", name, args == null ? ConnectionAssociationArgs.Empty : args, makeResourceOptions(options, Codegen.empty()));
    }

    private ConnectionAssociation(String name, Output<String> id, @Nullable ConnectionAssociationState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("aws:directconnect/connectionAssociation:ConnectionAssociation", name, state, makeResourceOptions(options, id));
    }

    private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output<String> 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 ConnectionAssociation get(String name, Output<String> id, @Nullable ConnectionAssociationState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        return new ConnectionAssociation(name, id, state, options);
    }
}
