Enable more TF tests (#5148)
This commit is contained in:
parent
ea4af2346c
commit
5d84eec79e
@ -229,6 +229,7 @@ class LayerVersion(CloudFormationModel):
|
|||||||
|
|
||||||
# optional
|
# optional
|
||||||
self.description = spec.get("Description", "")
|
self.description = spec.get("Description", "")
|
||||||
|
self.compatible_architectures = spec.get("CompatibleArchitectures", [])
|
||||||
self.compatible_runtimes = spec.get("CompatibleRuntimes", [])
|
self.compatible_runtimes = spec.get("CompatibleRuntimes", [])
|
||||||
self.license_info = spec.get("LicenseInfo", "")
|
self.license_info = spec.get("LicenseInfo", "")
|
||||||
|
|
||||||
@ -279,6 +280,7 @@ class LayerVersion(CloudFormationModel):
|
|||||||
"LayerArn": self._layer.layer_arn,
|
"LayerArn": self._layer.layer_arn,
|
||||||
"LayerVersionArn": self.arn,
|
"LayerVersionArn": self.arn,
|
||||||
"CreatedDate": self.created_date,
|
"CreatedDate": self.created_date,
|
||||||
|
"CompatibleArchitectures": self.compatible_architectures,
|
||||||
"CompatibleRuntimes": self.compatible_runtimes,
|
"CompatibleRuntimes": self.compatible_runtimes,
|
||||||
"Description": self.description,
|
"Description": self.description,
|
||||||
"LicenseInfo": self.license_info,
|
"LicenseInfo": self.license_info,
|
||||||
|
@ -75,6 +75,7 @@ class DaxCluster(BaseModel, ManagedState):
|
|||||||
replication_factor,
|
replication_factor,
|
||||||
iam_role_arn,
|
iam_role_arn,
|
||||||
sse_specification,
|
sse_specification,
|
||||||
|
encryption_type,
|
||||||
):
|
):
|
||||||
# Configure ManagedState
|
# Configure ManagedState
|
||||||
super().__init__(
|
super().__init__(
|
||||||
@ -100,6 +101,7 @@ class DaxCluster(BaseModel, ManagedState):
|
|||||||
{"SecurityGroupIdentifier": f"sg-{get_random_hex(10)}", "Status": "active"}
|
{"SecurityGroupIdentifier": f"sg-{get_random_hex(10)}", "Status": "active"}
|
||||||
]
|
]
|
||||||
self.sse_specification = sse_specification
|
self.sse_specification = sse_specification
|
||||||
|
self.encryption_type = encryption_type
|
||||||
|
|
||||||
def _create_new_node(self, idx):
|
def _create_new_node(self, idx):
|
||||||
return DaxNode(endpoint=self.endpoint, name=self.name, index=idx)
|
return DaxNode(endpoint=self.endpoint, name=self.name, index=idx)
|
||||||
@ -142,7 +144,7 @@ class DaxCluster(BaseModel, ManagedState):
|
|||||||
if self.sse_specification.get("Enabled") is True
|
if self.sse_specification.get("Enabled") is True
|
||||||
else "DISABLED"
|
else "DISABLED"
|
||||||
},
|
},
|
||||||
"ClusterEndpointEncryptionType": "NONE",
|
"ClusterEndpointEncryptionType": self.encryption_type,
|
||||||
"SecurityGroups": self.security_groups,
|
"SecurityGroups": self.security_groups,
|
||||||
}
|
}
|
||||||
if use_full_repr:
|
if use_full_repr:
|
||||||
@ -183,10 +185,11 @@ class DAXBackend(BaseBackend):
|
|||||||
iam_role_arn,
|
iam_role_arn,
|
||||||
tags,
|
tags,
|
||||||
sse_specification,
|
sse_specification,
|
||||||
|
encryption_type,
|
||||||
):
|
):
|
||||||
"""
|
"""
|
||||||
The following parameters are not yet processed:
|
The following parameters are not yet processed:
|
||||||
AvailabilityZones, SubnetGroupNames, SecurityGroups, PreferredMaintenanceWindow, NotificationTopicArn, ParameterGroupName, ClusterEndpointEncryptionType
|
AvailabilityZones, SubnetGroupNames, SecurityGroups, PreferredMaintenanceWindow, NotificationTopicArn, ParameterGroupName
|
||||||
"""
|
"""
|
||||||
cluster = DaxCluster(
|
cluster = DaxCluster(
|
||||||
region=self.region_name,
|
region=self.region_name,
|
||||||
@ -196,6 +199,7 @@ class DAXBackend(BaseBackend):
|
|||||||
replication_factor=replication_factor,
|
replication_factor=replication_factor,
|
||||||
iam_role_arn=iam_role_arn,
|
iam_role_arn=iam_role_arn,
|
||||||
sse_specification=sse_specification,
|
sse_specification=sse_specification,
|
||||||
|
encryption_type=encryption_type,
|
||||||
)
|
)
|
||||||
self.clusters[cluster_name] = cluster
|
self.clusters[cluster_name] = cluster
|
||||||
self._tagger.tag_resource(cluster.arn, tags)
|
self._tagger.tag_resource(cluster.arn, tags)
|
||||||
|
@ -20,6 +20,7 @@ class DAXResponse(BaseResponse):
|
|||||||
iam_role_arn = params.get("IamRoleArn")
|
iam_role_arn = params.get("IamRoleArn")
|
||||||
tags = params.get("Tags", [])
|
tags = params.get("Tags", [])
|
||||||
sse_specification = params.get("SSESpecification", {})
|
sse_specification = params.get("SSESpecification", {})
|
||||||
|
encryption_type = params.get("ClusterEndpointEncryptionType", "NONE")
|
||||||
|
|
||||||
self._validate_arn(iam_role_arn)
|
self._validate_arn(iam_role_arn)
|
||||||
self._validate_name(cluster_name)
|
self._validate_name(cluster_name)
|
||||||
@ -32,6 +33,7 @@ class DAXResponse(BaseResponse):
|
|||||||
iam_role_arn=iam_role_arn,
|
iam_role_arn=iam_role_arn,
|
||||||
tags=tags,
|
tags=tags,
|
||||||
sse_specification=sse_specification,
|
sse_specification=sse_specification,
|
||||||
|
encryption_type=encryption_type,
|
||||||
)
|
)
|
||||||
return json.dumps(dict(Cluster=cluster.to_json()))
|
return json.dumps(dict(Cluster=cluster.to_json()))
|
||||||
|
|
||||||
|
@ -806,7 +806,10 @@ class ECRBackend(BaseBackend):
|
|||||||
|
|
||||||
policy = json.loads(policy_text)
|
policy = json.loads(policy_text)
|
||||||
for statement in policy["Statement"]:
|
for statement in policy["Statement"]:
|
||||||
if set(statement["Action"]) - VALID_ACTIONS:
|
action = statement["Action"]
|
||||||
|
if isinstance(action, str):
|
||||||
|
action = [action]
|
||||||
|
if set(action) - VALID_ACTIONS:
|
||||||
raise MalformedPolicyDocument()
|
raise MalformedPolicyDocument()
|
||||||
|
|
||||||
def put_registry_policy(self, policy_text):
|
def put_registry_policy(self, policy_text):
|
||||||
|
@ -9,6 +9,7 @@ PATCH="etc/0001-Patch-Hardcode-endpoints-to-local-server.patch"
|
|||||||
(git apply $pwd/etc/0001-Patch-Hardcode-endpoints-to-local-server.patch > /dev/null 2>&1 && echo "Patched endpoints") || echo "Not patching endpoints - Directory was probably already patched."
|
(git apply $pwd/etc/0001-Patch-Hardcode-endpoints-to-local-server.patch > /dev/null 2>&1 && echo "Patched endpoints") || echo "Not patching endpoints - Directory was probably already patched."
|
||||||
(git apply $pwd/etc/0002-EC2-reduce-wait-times.patch > /dev/null 2>&1 && echo "Patched EC2") || echo "Not patching EC2 - Directory was probably already patched."
|
(git apply $pwd/etc/0002-EC2-reduce-wait-times.patch > /dev/null 2>&1 && echo "Patched EC2") || echo "Not patching EC2 - Directory was probably already patched."
|
||||||
(git apply $pwd/etc/0003-Patch-IAM-wait-times.patch > /dev/null 2>&1 && echo "Patched IAM") || echo "Not patching IAM - Directory was probably already patched."
|
(git apply $pwd/etc/0003-Patch-IAM-wait-times.patch > /dev/null 2>&1 && echo "Patched IAM") || echo "Not patching IAM - Directory was probably already patched."
|
||||||
|
(git apply $pwd/etc/0004-DAX-Reduce-wait-times.patch > /dev/null 2>&1 && echo "Patched DAX") || echo "Not patching DAX - Directory was probably already patched."
|
||||||
)
|
)
|
||||||
|
|
||||||
(
|
(
|
||||||
|
@ -12,7 +12,6 @@ TestAccCloudTrail
|
|||||||
TestAccEventsRule
|
TestAccEventsRule
|
||||||
TestAccCloudWatchEventTarget_ssmDocument
|
TestAccCloudWatchEventTarget_ssmDocument
|
||||||
TestAccCloudWatchMetricAlarm
|
TestAccCloudWatchMetricAlarm
|
||||||
TestAccDAX
|
|
||||||
TestAccEC2DefaultSecurityGroup
|
TestAccEC2DefaultSecurityGroup
|
||||||
TestAccEC2DefaultVPCAndSubnet
|
TestAccEC2DefaultVPCAndSubnet
|
||||||
TestAccMetaDefaultTagsDataSource
|
TestAccMetaDefaultTagsDataSource
|
||||||
@ -38,8 +37,6 @@ TestAccEc2TransitGatewayDxGatewayAttachmentDataSource
|
|||||||
TestAccEc2TransitGatewayPeeringAttachmentAccepter
|
TestAccEc2TransitGatewayPeeringAttachmentAccepter
|
||||||
TestAccEc2TransitGatewayRouteTableAssociation
|
TestAccEc2TransitGatewayRouteTableAssociation
|
||||||
TestAccEc2TransitGatewayVpcAttachment
|
TestAccEc2TransitGatewayVpcAttachment
|
||||||
TestAccEcrRegistryPolicy
|
|
||||||
TestAccEcrReplicationConfiguration
|
|
||||||
TestAccEC2EgressOnlyInternetGateway
|
TestAccEC2EgressOnlyInternetGateway
|
||||||
TestAccEFSMountTarget
|
TestAccEFSMountTarget
|
||||||
TestAccEksClusterDataSource
|
TestAccEksClusterDataSource
|
||||||
@ -48,8 +45,6 @@ TestAccIotThing
|
|||||||
TestAccIPRanges
|
TestAccIPRanges
|
||||||
TestAccKinesisStream
|
TestAccKinesisStream
|
||||||
TestAccELBPolicy
|
TestAccELBPolicy
|
||||||
TestAccLambdaAlias
|
|
||||||
TestAccLambdaLayerVersion
|
|
||||||
TestAccPartition
|
TestAccPartition
|
||||||
TestAccPinpointApp
|
TestAccPinpointApp
|
||||||
TestAccPinpointEventStream
|
TestAccPinpointEventStream
|
||||||
|
@ -30,6 +30,9 @@ cognitoidp:
|
|||||||
- TestAccCognitoUserInGroup_
|
- TestAccCognitoUserInGroup_
|
||||||
- TestAccCognitoIDPUserPoolClients
|
- TestAccCognitoIDPUserPoolClients
|
||||||
- TestAccCognitoIDPUserPoolClientDataSource
|
- TestAccCognitoIDPUserPoolClientDataSource
|
||||||
|
dax:
|
||||||
|
- TestAccDAXCluster_basic
|
||||||
|
- TestAccDAXCluster_Encryption
|
||||||
dynamodb:
|
dynamodb:
|
||||||
- TestAccDynamoDBTableItem
|
- TestAccDynamoDBTableItem
|
||||||
ec2:
|
ec2:
|
||||||
@ -40,13 +43,18 @@ ec2:
|
|||||||
- TestAccEC2InternetGateway_
|
- TestAccEC2InternetGateway_
|
||||||
- TestAccEC2NATGateway_
|
- TestAccEC2NATGateway_
|
||||||
- TestAccEC2RouteTableAssociation_
|
- TestAccEC2RouteTableAssociation_
|
||||||
|
- TestAccEC2SecurityGroups
|
||||||
- TestAccEC2SpotInstanceRequest_disappears
|
- TestAccEC2SpotInstanceRequest_disappears
|
||||||
- TestAccEC2SpotInstanceRequest_interruptUpdate
|
- TestAccEC2SpotInstanceRequest_interruptUpdate
|
||||||
- TestAccEC2VPCEndpointService_
|
- TestAccEC2VPCEndpointService_
|
||||||
|
- TestAccEC2VPCPeeringConnectionAccepter_
|
||||||
|
- TestAccEC2VPCsDataSource
|
||||||
- TestAccEC2VPNGateway_
|
- TestAccEC2VPNGateway_
|
||||||
- TestAccEC2VPNGatewayAttachment_
|
- TestAccEC2VPNGatewayAttachment_
|
||||||
ecr:
|
ecr:
|
||||||
- TestAccECRLifecyclePolicy
|
- TestAccECRLifecyclePolicy
|
||||||
|
- TestAccECRRegistryPolicy
|
||||||
|
- TestAccECRReplicationConfiguration
|
||||||
- TestAccECRRepository
|
- TestAccECRRepository
|
||||||
- TestAccECRRepositoryDataSource
|
- TestAccECRRepositoryDataSource
|
||||||
- TestAccECRRepositoryPolicy
|
- TestAccECRRepositoryPolicy
|
||||||
@ -107,6 +115,9 @@ kms:
|
|||||||
- TestAccKMSKey_Policy_iamServiceLinkedRole
|
- TestAccKMSKey_Policy_iamServiceLinkedRole
|
||||||
- TestAccKMSSecretDataSource
|
- TestAccKMSSecretDataSource
|
||||||
- TestAccKMSSecretsDataSource
|
- TestAccKMSSecretsDataSource
|
||||||
|
lambda:
|
||||||
|
- TestAccLambdaAlias_
|
||||||
|
- TestAccLambdaLayerVersion_
|
||||||
meta:
|
meta:
|
||||||
- TestAccMetaBillingServiceAccountDataSource
|
- TestAccMetaBillingServiceAccountDataSource
|
||||||
mq:
|
mq:
|
||||||
|
@ -76,6 +76,7 @@ def test_get_lambda_layers():
|
|||||||
"CompatibleRuntimes": ["python3.6"],
|
"CompatibleRuntimes": ["python3.6"],
|
||||||
"Description": "",
|
"Description": "",
|
||||||
"LicenseInfo": "MIT",
|
"LicenseInfo": "MIT",
|
||||||
|
"CompatibleArchitectures": [],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Version": 2,
|
"Version": 2,
|
||||||
@ -83,6 +84,7 @@ def test_get_lambda_layers():
|
|||||||
"CompatibleRuntimes": ["python3.6"],
|
"CompatibleRuntimes": ["python3.6"],
|
||||||
"Description": "",
|
"Description": "",
|
||||||
"LicenseInfo": "MIT",
|
"LicenseInfo": "MIT",
|
||||||
|
"CompatibleArchitectures": [],
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
@ -154,10 +156,16 @@ def test_get_layer_version():
|
|||||||
Content={"ZipFile": get_test_zip_file1()},
|
Content={"ZipFile": get_test_zip_file1()},
|
||||||
CompatibleRuntimes=["python3.6"],
|
CompatibleRuntimes=["python3.6"],
|
||||||
LicenseInfo="MIT",
|
LicenseInfo="MIT",
|
||||||
|
CompatibleArchitectures=["x86_64"],
|
||||||
)
|
)
|
||||||
layer_version = resp["Version"]
|
layer_version = resp["Version"]
|
||||||
|
|
||||||
resp = conn.get_layer_version(LayerName=layer_name, VersionNumber=layer_version)
|
resp = conn.get_layer_version(LayerName=layer_name, VersionNumber=layer_version)
|
||||||
|
resp.should.have.key("Description").equals("")
|
||||||
|
resp.should.have.key("Version").equals(1)
|
||||||
|
resp.should.have.key("CompatibleArchitectures").equals(["x86_64"])
|
||||||
|
resp.should.have.key("CompatibleRuntimes").equals(["python3.6"])
|
||||||
|
resp.should.have.key("LicenseInfo").equals("MIT")
|
||||||
|
|
||||||
|
|
||||||
@mock_lambda
|
@mock_lambda
|
||||||
|
@ -281,6 +281,7 @@ def lambda_handler(event, context):
|
|||||||
"Description": "Test Layer",
|
"Description": "Test Layer",
|
||||||
"CompatibleRuntimes": ["python2.7", "python3.6"],
|
"CompatibleRuntimes": ["python2.7", "python3.6"],
|
||||||
"LicenseInfo": "MIT",
|
"LicenseInfo": "MIT",
|
||||||
|
"CompatibleArchitectures": [],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -305,6 +306,7 @@ def lambda_handler(event, context):
|
|||||||
"CompatibleRuntimes": ["python2.7", "python3.6"],
|
"CompatibleRuntimes": ["python2.7", "python3.6"],
|
||||||
"Description": "Test Layer",
|
"Description": "Test Layer",
|
||||||
"LicenseInfo": "MIT",
|
"LicenseInfo": "MIT",
|
||||||
|
"CompatibleArchitectures": [],
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
@ -79,6 +79,7 @@ def test_create_cluster_with_sse_enabled():
|
|||||||
ReplicationFactor=3,
|
ReplicationFactor=3,
|
||||||
IamRoleArn=iam_role_arn,
|
IamRoleArn=iam_role_arn,
|
||||||
SSESpecification={"Enabled": True},
|
SSESpecification={"Enabled": True},
|
||||||
|
ClusterEndpointEncryptionType="TLS",
|
||||||
)["Cluster"]
|
)["Cluster"]
|
||||||
|
|
||||||
described_cluster = client.describe_clusters(ClusterNames=["daxcluster"])[
|
described_cluster = client.describe_clusters(ClusterNames=["daxcluster"])[
|
||||||
@ -88,6 +89,7 @@ def test_create_cluster_with_sse_enabled():
|
|||||||
for cluster in [created_cluster, described_cluster]:
|
for cluster in [created_cluster, described_cluster]:
|
||||||
cluster["ClusterName"].should.equal("daxcluster")
|
cluster["ClusterName"].should.equal("daxcluster")
|
||||||
cluster["SSEDescription"].should.equal({"Status": "ENABLED"})
|
cluster["SSEDescription"].should.equal({"Status": "ENABLED"})
|
||||||
|
cluster["ClusterEndpointEncryptionType"].should.equal("TLS")
|
||||||
|
|
||||||
|
|
||||||
@mock_dax
|
@mock_dax
|
||||||
|
@ -2053,7 +2053,12 @@ def test_delete_lifecycle_policy_error_policy_not_exists():
|
|||||||
|
|
||||||
|
|
||||||
@mock_ecr
|
@mock_ecr
|
||||||
def test_put_registry_policy():
|
@pytest.mark.parametrize(
|
||||||
|
"actions",
|
||||||
|
["ecr:CreateRepository", ["ecr:CreateRepository", "ecr:ReplicateImage"]],
|
||||||
|
ids=["single-action", "multiple-actions"],
|
||||||
|
)
|
||||||
|
def test_put_registry_policy(actions):
|
||||||
# given
|
# given
|
||||||
client = boto3.client("ecr", region_name="eu-central-1")
|
client = boto3.client("ecr", region_name="eu-central-1")
|
||||||
policy = {
|
policy = {
|
||||||
@ -2064,7 +2069,7 @@ def test_put_registry_policy():
|
|||||||
"Principal": {
|
"Principal": {
|
||||||
"AWS": ["arn:aws:iam::111111111111:root", "222222222222"]
|
"AWS": ["arn:aws:iam::111111111111:root", "222222222222"]
|
||||||
},
|
},
|
||||||
"Action": ["ecr:CreateRepository", "ecr:ReplicateImage"],
|
"Action": actions,
|
||||||
"Resource": "*",
|
"Resource": "*",
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user