from troposphere import Parameter, Ref

from .template import template

dont_create_value = "(none)"

arn_prefix = Ref(template.add_parameter(
    Parameter(
        "ArnPrefix",
        Description="The prefix to use for Amazon Resource Names (ARNs).",
        Type="String",
        Default="arn:aws",
        AllowedValues=["arn:aws", "arn:aws-us-gov"],
    ),
    group="Global",
    label="Amazon ARN prefix",
))


container_instance_type = Ref(template.add_parameter(
    Parameter(
        "ContainerInstanceType",
        Description="The application server instance type",
        Type="String",
        Default="t2.micro",
        AllowedValues=[
            't2.nano',
            't2.micro',
            't2.small',
            't2.medium',
            't2.large',
            't2.xlarge',
            't2.2xlarge',
            'm4.large',
            'm4.xlarge',
            'm4.2xlarge',
            'm4.4xlarge',
            'm4.10xlarge',
            'm4.16xlarge',
            'm3.medium',
            'm3.large',
            'm3.xlarge',
            'm3.2xlarge',
            'c4.large',
            'c4.xlarge',
            'c4.2xlarge',
            'c4.4xlarge',
            'c4.8xlarge',
            'c3.large',
            'c3.xlarge',
            'c3.2xlarge',
            'c3.4xlarge',
            'c3.8xlarge',
            'p2.xlarge',
            'p2.8xlarge',
            'p2.16xlarge',
            'g2.2xlarge',
            'g2.8xlarge',
            'x1.16large',
            'x1.32xlarge',
            'r4.large',
            'r4.xlarge',
            'r4.2xlarge',
            'r4.4xlarge',
            'r4.8xlarge',
            'r4.16xlarge',
            'r3.large',
            'r3.xlarge',
            'r3.2xlarge',
            'r3.4xlarge',
            'r3.8xlarge',
            'i3.large',
            'i3.xlarge',
            'i3.2xlarge',
            'i3.4xlarge',
            'i3.8xlarge',
            'i3.16large',
            'd2.xlarge',
            'd2.2xlarge',
            'd2.4xlarge',
            'd2.8xlarge',
            'f1.2xlarge',
            'f1.16xlarge',
        ]
    ),
    group="Application Server",
    label="Instance Type",
))

secret_key = Ref(template.add_parameter(
    Parameter(
        "SecretKey",
        Description="Application secret key for this stack (optional)",
        Type="String",
    ),
    group="Application Server",
    label="Secret Key",
))

@@ -16,16 +16,40 @@
 e import
+ AWS_REGION, Equals, If,
  Paramet
@@ -56,16 +56,16 @@
 er, Ref%0A
-
 %0Afrom .t
@@ -123,324 +123,197 @@
 )%22%0A%0A
-arn_prefix = Ref(template.add_parameter(%0A    Parameter(%0A        %22ArnPrefix%22,%0A        Description=%22The prefix to use for Amazon Resource Names (ARNs).%22,%0A        Type=%22String%22,%0A        Default=%22arn:aws%22,%0A        AllowedValues=%5B%22arn:aws%22, %22arn:aws-us-gov%22%5D,%0A    ),%0A    group=%22Global%22,%0A    label=%22Amazon ARN prefix%22,%0A))%0A
+in_govcloud_region = %22InGovCloudRegion%22%0Atemplate.add_condition(in_govcloud_region, Equals(Ref(AWS_REGION), %22us-gov-west-1%22))%0Aarn_prefix = If(in_govcloud_region, %22arn:aws-us-gov%22, %22arn:aws%22)
 %0A%0Aco

remove unnecessary parameter "ArnPrefix"