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

export interface UserPoolDomainArgs extends core.ResourceArgs {
  /**
   * (Optional) The ARN of an ISSUED ACM certificate in us-east-1 for a custom domain.
   */
  certificateArn?: string | core.StringOut;

  /**
   * (Required) For custom domains, this is the fully-qualified domain name, such as auth.example.com. Fo
   * r Amazon Cognito prefix domains, this is the prefix alone, such as auth.
   */
  domain: string | core.StringOut;

  /**
   * (Required) The user pool ID.
   */
  userPoolId: string | core.StringOut;
}

export class UserPoolDomain extends core.Resource<UserPoolDomainArgs> {
  /**
   * The AWS account ID for the user pool owner.
   */
  @core.attr(String, { computed: true })
  public awsAccountId!: string | core.StringOut;

  /**
   * (Optional) The ARN of an ISSUED ACM certificate in us-east-1 for a custom domain.
   */
  @core.attr(String)
  public certificateArn?: string | core.StringOut;

  /**
   * The URL of the CloudFront distribution. This is required to generate the ALIAS `aws_route53_record`
   */
  @core.attr(String, { computed: true })
  public cloudfrontDistributionArn!: string | core.StringOut;

  /**
   * (Required) For custom domains, this is the fully-qualified domain name, such as auth.example.com. Fo
   * r Amazon Cognito prefix domains, this is the prefix alone, such as auth.
   */
  @core.attr(String)
  public domain!: string | core.StringOut;

  @core.attr(String, { computed: true })
  public id!: string | core.StringOut;

  /**
   * The S3 bucket where the static files for this domain are stored.
   */
  @core.attr(String, { computed: true })
  public s3Bucket!: string | core.StringOut;

  /**
   * (Required) The user pool ID.
   */
  @core.attr(String)
  public userPoolId!: string | core.StringOut;

  /**
   * The app version.
   */
  @core.attr(String, { computed: true })
  public version!: string | core.StringOut;

  constructor(name: string, args?: UserPoolDomainArgs) {
    super(name, "aws_cognito_user_pool_domain", args);
  }

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