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

export interface PullThroughCacheRuleArgs extends core.ResourceArgs {
  ecrRepositoryPrefix: string | core.StringOut;

  upstreamRegistryUrl: string | core.StringOut;
}

export class PullThroughCacheRule extends core.Resource<PullThroughCacheRuleArgs> {
  @core.attr(String)
  public ecrRepositoryPrefix!: string | core.StringOut;

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

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

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

  constructor(name: string, args?: PullThroughCacheRuleArgs) {
    super(name, "aws_ecr_pull_through_cache_rule", args);
  }

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