import * as core from "@terrascript/core";

export interface ConnectionArgs extends core.ResourceArgs {
  /**
   * (Optional) The Amazon Resource Name (ARN) of the host associated with the connection. Conflicts with
   * provider_type`
   */
  hostArn?: string | core.StringOut;

  /**
   * (Required) The name of the connection to be created. The name must be unique in the calling AWS acco
   * unt. Changing `name` will create a new resource.
   */
  name: string | core.StringOut;

  /**
   * (Optional) The name of the external provider where your third-party code repository is configured. V
   * alid values are `Bitbucket`, `GitHub` or `GitHubEnterpriseServer`. Changing `provider_type` will cre
   * ate a new resource. Conflicts with `host_arn`
   */
  providerType?: string | core.StringOut;

  /**
   * (Optional) Map of key-value resource tags to associate with the resource. If configured with a provi
   * der [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/lates
   * t/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defin
   * ed at the provider-level.
   */
  tags?: core.Map<string, string> | core.MapOut<core.StringOut>;

  /**
   * A map of tags assigned to the resource, including those inherited from the provider [`default_tags`
   * configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-
   * configuration-block).
   */
  tagsAll?: core.Map<string, string> | core.MapOut<core.StringOut>;
}

export class Connection extends core.Resource<ConnectionArgs> {
  /**
   * The codestar connection ARN.
   */
  @core.attr(String, { computed: true })
  public arn!: string | core.StringOut;

  /**
   * The codestar connection status. Possible values are `PENDING`, `AVAILABLE` and `ERROR`.
   */
  @core.attr(String, { computed: true })
  public connectionStatus!: string | core.StringOut;

  /**
   * (Optional) The Amazon Resource Name (ARN) of the host associated with the connection. Conflicts with
   * provider_type`
   */
  @core.attr(String)
  public hostArn?: string | core.StringOut;

  /**
   * The codestar connection ARN.
   */
  @core.attr(String, { computed: true })
  public id!: string | core.StringOut;

  /**
   * (Required) The name of the connection to be created. The name must be unique in the calling AWS acco
   * unt. Changing `name` will create a new resource.
   */
  @core.attr(String)
  public name!: string | core.StringOut;

  /**
   * (Optional) The name of the external provider where your third-party code repository is configured. V
   * alid values are `Bitbucket`, `GitHub` or `GitHubEnterpriseServer`. Changing `provider_type` will cre
   * ate a new resource. Conflicts with `host_arn`
   */
  @core.attr(String, { computed: true })
  public providerType?: string | core.StringOut;

  /**
   * (Optional) Map of key-value resource tags to associate with the resource. If configured with a provi
   * der [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/lates
   * t/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defin
   * ed at the provider-level.
   */
  @core.attr(String, { kind: "map" })
  public tags?: core.Map<string, string> | core.MapOut<core.StringOut>;

  /**
   * A map of tags assigned to the resource, including those inherited from the provider [`default_tags`
   * configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-
   * configuration-block).
   */
  @core.attr(String, { computed: true, kind: "map" })
  public tagsAll?: core.Map<string, string> | core.MapOut<core.StringOut>;

  constructor(name: string, args?: ConnectionArgs) {
    super(name, "aws_codestarconnections_connection", args);
  }

  public override getNamespace(): string {
    return "aws_codestarconnections";
  }
}
