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

export interface VpcConfigurationArgs extends core.SchemaArgs {
  securityGroupIds: core.Array<string> | core.ArrayOut<core.StringOut>;

  subnetIds: core.Array<string> | core.ArrayOut<core.StringOut>;

  tlsCertificate?: string | core.StringOut;

  vpcId: string | core.StringOut;
}

export class VpcConfiguration extends core.Schema<VpcConfigurationArgs> {
  @core.attr(String, { kind: "array" })
  public securityGroupIds!: core.Array<string> | core.ArrayOut<core.StringOut>;

  @core.attr(String, { kind: "array" })
  public subnetIds!: core.Array<string> | core.ArrayOut<core.StringOut>;

  @core.attr(String)
  public tlsCertificate?: string | core.StringOut;

  @core.attr(String)
  public vpcId!: string | core.StringOut;
}

export interface HostArgs extends core.ResourceArgs {
  /**
   * (Required) The name of the host to be created. The name must be unique in the calling AWS account.
   */
  name: string | core.StringOut;

  /**
   * (Required) The endpoint of the infrastructure to be represented by the host after it is created.
   */
  providerEndpoint: string | core.StringOut;

  /**
   * (Required) The name of the external provider where your third-party code repository is configured.
   */
  providerType: string | core.StringOut;

  /**
   * (Optional) The VPC configuration to be provisioned for the host. A VPC must be configured, and the i
   * nfrastructure to be represented by the host must already be connected to the VPC.
   */
  vpcConfiguration?: VpcConfiguration;
}

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

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

  /**
   * (Required) The name of the host to be created. The name must be unique in the calling AWS account.
   */
  @core.attr(String)
  public name!: string | core.StringOut;

  /**
   * (Required) The endpoint of the infrastructure to be represented by the host after it is created.
   */
  @core.attr(String)
  public providerEndpoint!: string | core.StringOut;

  /**
   * (Required) The name of the external provider where your third-party code repository is configured.
   */
  @core.attr(String)
  public providerType!: string | core.StringOut;

  /**
   * The CodeStar Host status. Possible values are `PENDING`, `AVAILABLE`, `VPC_CONFIG_DELETING`, `VPC_CO
   * NFIG_INITIALIZING`, and `VPC_CONFIG_FAILED_INITIALIZATION`.
   */
  @core.attr(String, { computed: true })
  public status!: string | core.StringOut;

  /**
   * (Optional) The VPC configuration to be provisioned for the host. A VPC must be configured, and the i
   * nfrastructure to be represented by the host must already be connected to the VPC.
   */
  @core.attr(VpcConfiguration)
  public vpcConfiguration?: VpcConfiguration;

  constructor(name: string, args?: HostArgs) {
    super(name, "aws_codestarconnections_host", args);
  }

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