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

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

  triggerName: string | core.StringOut;

  triggerTargetArn: string | core.StringOut;
}

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

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

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

export interface ElbInfoArgs extends core.SchemaArgs {
  name?: string | core.StringOut;
}

export class ElbInfo extends core.Schema<ElbInfoArgs> {
  @core.attr(String)
  public name?: string | core.StringOut;
}

export interface TargetGroupInfoArgs extends core.SchemaArgs {
  name?: string | core.StringOut;
}

export class TargetGroupInfo extends core.Schema<TargetGroupInfoArgs> {
  @core.attr(String)
  public name?: string | core.StringOut;
}

export interface TestTrafficRouteArgs extends core.SchemaArgs {
  listenerArns: core.Array<string> | core.ArrayOut<core.StringOut>;
}

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

export interface ProdTrafficRouteArgs extends core.SchemaArgs {
  listenerArns: core.Array<string> | core.ArrayOut<core.StringOut>;
}

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

export interface TargetGroupArgs extends core.SchemaArgs {
  name: string | core.StringOut;
}

export class TargetGroup extends core.Schema<TargetGroupArgs> {
  @core.attr(String)
  public name!: string | core.StringOut;
}

export interface TargetGroupPairInfoArgs extends core.SchemaArgs {
  prodTrafficRoute: ProdTrafficRoute;

  targetGroup: core.Array<TargetGroup> | core.ArrayOut<TargetGroup>;

  testTrafficRoute?: TestTrafficRoute;
}

export class TargetGroupPairInfo extends core.Schema<TargetGroupPairInfoArgs> {
  @core.attr(ProdTrafficRoute)
  public prodTrafficRoute!: ProdTrafficRoute;

  @core.attr(TargetGroup, { kind: "array" })
  public targetGroup!: core.Array<TargetGroup> | core.ArrayOut<TargetGroup>;

  @core.attr(TestTrafficRoute)
  public testTrafficRoute?: TestTrafficRoute;
}

export interface LoadBalancerInfoArgs extends core.SchemaArgs {
  elbInfo?: core.Array<ElbInfo> | core.ArrayOut<ElbInfo>;

  targetGroupInfo?:
    | core.Array<TargetGroupInfo>
    | core.ArrayOut<TargetGroupInfo>;

  targetGroupPairInfo?: TargetGroupPairInfo;
}

export class LoadBalancerInfo extends core.Schema<LoadBalancerInfoArgs> {
  @core.attr(ElbInfo, { kind: "array" })
  public elbInfo?: core.Array<ElbInfo> | core.ArrayOut<ElbInfo>;

  @core.attr(TargetGroupInfo, { kind: "array" })
  public targetGroupInfo?:
    | core.Array<TargetGroupInfo>
    | core.ArrayOut<TargetGroupInfo>;

  @core.attr(TargetGroupPairInfo)
  public targetGroupPairInfo?: TargetGroupPairInfo;
}

export interface Ec2TagFilterArgs extends core.SchemaArgs {
  key?: string | core.StringOut;

  type?: string | core.StringOut;

  value?: string | core.StringOut;
}

export class Ec2TagFilter extends core.Schema<Ec2TagFilterArgs> {
  @core.attr(String)
  public key?: string | core.StringOut;

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

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

export interface Ec2TagSetArgs extends core.SchemaArgs {
  ec2TagFilter?: core.Array<Ec2TagFilter> | core.ArrayOut<Ec2TagFilter>;
}

export class Ec2TagSet extends core.Schema<Ec2TagSetArgs> {
  @core.attr(Ec2TagFilter, { kind: "array" })
  public ec2TagFilter?: core.Array<Ec2TagFilter> | core.ArrayOut<Ec2TagFilter>;
}

export interface AutoRollbackConfigurationArgs extends core.SchemaArgs {
  enabled?: boolean | core.BooleanOut;

  events?: core.Array<string> | core.ArrayOut<core.StringOut>;
}

export class AutoRollbackConfiguration extends core.Schema<AutoRollbackConfigurationArgs> {
  @core.attr(Boolean)
  public enabled?: boolean | core.BooleanOut;

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

export interface DeploymentStyleArgs extends core.SchemaArgs {
  deploymentOption?: string | core.StringOut;

  deploymentType?: string | core.StringOut;
}

export class DeploymentStyle extends core.Schema<DeploymentStyleArgs> {
  @core.attr(String)
  public deploymentOption?: string | core.StringOut;

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

export interface OnPremisesInstanceTagFilterArgs extends core.SchemaArgs {
  key?: string | core.StringOut;

  type?: string | core.StringOut;

  value?: string | core.StringOut;
}

export class OnPremisesInstanceTagFilter extends core.Schema<OnPremisesInstanceTagFilterArgs> {
  @core.attr(String)
  public key?: string | core.StringOut;

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

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

export interface AlarmConfigurationArgs extends core.SchemaArgs {
  alarms?: core.Array<string> | core.ArrayOut<core.StringOut>;

  enabled?: boolean | core.BooleanOut;

  ignorePollAlarmFailure?: boolean | core.BooleanOut;
}

export class AlarmConfiguration extends core.Schema<AlarmConfigurationArgs> {
  @core.attr(String, { kind: "array" })
  public alarms?: core.Array<string> | core.ArrayOut<core.StringOut>;

  @core.attr(Boolean)
  public enabled?: boolean | core.BooleanOut;

  @core.attr(Boolean)
  public ignorePollAlarmFailure?: boolean | core.BooleanOut;
}

export interface DeploymentReadyOptionArgs extends core.SchemaArgs {
  actionOnTimeout?: string | core.StringOut;

  waitTimeInMinutes?: number | core.NumberOut;
}

export class DeploymentReadyOption extends core.Schema<DeploymentReadyOptionArgs> {
  @core.attr(String)
  public actionOnTimeout?: string | core.StringOut;

  @core.attr(Number)
  public waitTimeInMinutes?: number | core.NumberOut;
}

export interface GreenFleetProvisioningOptionArgs extends core.SchemaArgs {
  action?: string | core.StringOut;
}

export class GreenFleetProvisioningOption extends core.Schema<GreenFleetProvisioningOptionArgs> {
  @core.attr(String)
  public action?: string | core.StringOut;
}

export interface TerminateBlueInstancesOnDeploymentSuccessArgs
  extends core.SchemaArgs {
  action?: string | core.StringOut;

  terminationWaitTimeInMinutes?: number | core.NumberOut;
}

export class TerminateBlueInstancesOnDeploymentSuccess extends core.Schema<TerminateBlueInstancesOnDeploymentSuccessArgs> {
  @core.attr(String)
  public action?: string | core.StringOut;

  @core.attr(Number)
  public terminationWaitTimeInMinutes?: number | core.NumberOut;
}

export interface BlueGreenDeploymentConfigArgs extends core.SchemaArgs {
  deploymentReadyOption?: DeploymentReadyOption;

  greenFleetProvisioningOption?: GreenFleetProvisioningOption;

  terminateBlueInstancesOnDeploymentSuccess?: TerminateBlueInstancesOnDeploymentSuccess;
}

export class BlueGreenDeploymentConfig extends core.Schema<BlueGreenDeploymentConfigArgs> {
  @core.attr(DeploymentReadyOption)
  public deploymentReadyOption?: DeploymentReadyOption;

  @core.attr(GreenFleetProvisioningOption, { computed: true })
  public greenFleetProvisioningOption?: GreenFleetProvisioningOption;

  @core.attr(TerminateBlueInstancesOnDeploymentSuccess)
  public terminateBlueInstancesOnDeploymentSuccess?: TerminateBlueInstancesOnDeploymentSuccess;
}

export interface EcsServiceArgs extends core.SchemaArgs {
  clusterName: string | core.StringOut;

  serviceName: string | core.StringOut;
}

export class EcsService extends core.Schema<EcsServiceArgs> {
  @core.attr(String)
  public clusterName!: string | core.StringOut;

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

export interface DeploymentGroupArgs extends core.ResourceArgs {
  alarmConfiguration?: AlarmConfiguration;

  appName: string | core.StringOut;

  autoRollbackConfiguration?: AutoRollbackConfiguration;

  autoscalingGroups?: core.Array<string> | core.ArrayOut<core.StringOut>;

  blueGreenDeploymentConfig?: BlueGreenDeploymentConfig;

  deploymentConfigName?: string | core.StringOut;

  deploymentGroupName: string | core.StringOut;

  deploymentStyle?: DeploymentStyle;

  ec2TagFilter?: core.Array<Ec2TagFilter> | core.ArrayOut<Ec2TagFilter>;

  ec2TagSet?: core.Array<Ec2TagSet> | core.ArrayOut<Ec2TagSet>;

  ecsService?: EcsService;

  loadBalancerInfo?: LoadBalancerInfo;

  onPremisesInstanceTagFilter?:
    | core.Array<OnPremisesInstanceTagFilter>
    | core.ArrayOut<OnPremisesInstanceTagFilter>;

  serviceRoleArn: string | core.StringOut;

  tags?: core.Map<string, string> | core.MapOut<core.StringOut>;

  tagsAll?: core.Map<string, string> | core.MapOut<core.StringOut>;

  triggerConfiguration?:
    | core.Array<TriggerConfiguration>
    | core.ArrayOut<TriggerConfiguration>;
}

export class DeploymentGroup extends core.Resource<DeploymentGroupArgs> {
  @core.attr(AlarmConfiguration)
  public alarmConfiguration?: AlarmConfiguration;

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

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

  @core.attr(AutoRollbackConfiguration)
  public autoRollbackConfiguration?: AutoRollbackConfiguration;

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

  @core.attr(BlueGreenDeploymentConfig, { computed: true })
  public blueGreenDeploymentConfig?: BlueGreenDeploymentConfig;

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

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

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

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

  @core.attr(DeploymentStyle)
  public deploymentStyle?: DeploymentStyle;

  @core.attr(Ec2TagFilter, { kind: "array" })
  public ec2TagFilter?: core.Array<Ec2TagFilter> | core.ArrayOut<Ec2TagFilter>;

  @core.attr(Ec2TagSet, { kind: "array" })
  public ec2TagSet?: core.Array<Ec2TagSet> | core.ArrayOut<Ec2TagSet>;

  @core.attr(EcsService)
  public ecsService?: EcsService;

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

  @core.attr(LoadBalancerInfo)
  public loadBalancerInfo?: LoadBalancerInfo;

  @core.attr(OnPremisesInstanceTagFilter, { kind: "array" })
  public onPremisesInstanceTagFilter?:
    | core.Array<OnPremisesInstanceTagFilter>
    | core.ArrayOut<OnPremisesInstanceTagFilter>;

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

  @core.attr(String, { kind: "map" })
  public tags?: core.Map<string, string> | core.MapOut<core.StringOut>;

  @core.attr(String, { computed: true, kind: "map" })
  public tagsAll?: core.Map<string, string> | core.MapOut<core.StringOut>;

  @core.attr(TriggerConfiguration, { kind: "array" })
  public triggerConfiguration?:
    | core.Array<TriggerConfiguration>
    | core.ArrayOut<TriggerConfiguration>;

  constructor(name: string, args?: DeploymentGroupArgs) {
    super(name, "aws_codedeploy_deployment_group", args);
  }

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