kumogata-template 0.0.33 → 0.0.34
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/README.md +30 -49
- data/kumogata-template.gemspec +1 -1
- data/lib/kumogata/template/ec2.rb +16 -18
- data/lib/kumogata/template/helper.rb +14 -36
- data/lib/kumogata/template/iam.rb +2 -0
- data/lib/kumogata/template/s3.rb +15 -0
- data/lib/kumogata/template/sns.rb +7 -2
- data/lib/kumogata/template/version.rb +1 -1
- data/template/ec2-customer-gateway.rb +21 -0
- data/template/ec2-dhcp-options.rb +25 -0
- data/template/ec2-egress-only-internet-gateway.rb +15 -0
- data/template/ec2-instance.rb +2 -2
- data/template/ec2-network-interface-attachment.rb +22 -0
- data/template/ec2-network-interface.rb +32 -0
- data/template/ec2-placement-group.rb +17 -0
- data/template/ec2-security-group-egress.rb +15 -0
- data/template/ec2-security-group-ingress.rb +19 -0
- data/template/ec2-security-group.rb +4 -4
- data/template/ec2-subnet-cidr-block.rb +17 -0
- data/template/ec2-vpc-cidr-block.rb +17 -0
- data/template/ec2-vpc-dhcp-options-association.rb +17 -0
- data/template/ec2-vpc-peering-connection.rb +23 -0
- data/template/ec2-vpn-connection-route.rb +17 -0
- data/template/ec2-vpn-connection.rb +23 -0
- data/template/ec2-vpn-gateway-route-propagation.rb +17 -0
- data/template/ec2-vpn-gateway.rb +17 -0
- data/template/ecs-service.rb +2 -2
- data/template/iam-group.rb +2 -2
- data/template/iam-instance-profile.rb +2 -2
- data/template/iam-role.rb +2 -2
- data/template/iam-user.rb +2 -2
- data/template/output-access-key.rb +2 -2
- data/template/{output-iam-instance-profile.rb → output-instance-profile.rb} +1 -1
- data/template/output-network-interface.rb +14 -0
- data/template/{output-iam-role.rb → output-role.rb} +1 -1
- data/template/{output-ec2-subnet.rb → output-subnet.rb} +1 -1
- data/template/rds-db-instance.rb +5 -1
- data/template/s3-bucket.rb +1 -2
- data/template/sns-topic.rb +2 -2
- data/test/ec2_test.rb +17 -18
- data/test/helper_test.rb +4 -2
- data/test/sns_test.rb +16 -0
- data/test/template/ec2-customer-gateway_tet.rb +55 -0
- data/test/template/ec2-dhcp-options_test.rb +49 -0
- data/test/template/ec2-egress-only-internet-gateway_test.rb +23 -0
- data/test/template/ec2-instance_test.rb +1 -1
- data/test/template/ec2-network-interface-attachment_tet.rb +28 -0
- data/test/template/ec2-network-interface_test.rb +52 -0
- data/test/template/ec2-placement-group_test.rb +21 -0
- data/test/template/ec2-security-group-egress_test.rb +25 -0
- data/test/template/ec2-security-group-ingress_test.rb +25 -0
- data/test/template/ec2-security-group_test.rb +1 -0
- data/test/template/ec2-subnet-cidr-block_test.rb +26 -0
- data/test/template/ec2-vpc-cidr-block_test.rb +24 -0
- data/test/template/ec2-vpc-dhcp-options-association_test.rb +26 -0
- data/test/template/ec2-vpc-peering-connection_test.rb +54 -0
- data/test/template/ec2-vpn-connection-route_test.rb +26 -0
- data/test/template/ec2-vpn-connection_test.rb +56 -0
- data/test/template/ec2-vpn-gateway-route-propagation_test.rb +28 -0
- data/test/template/ec2-vpn-gateway_test.rb +49 -0
- data/test/template/ecs-service_test.rb +1 -0
- data/test/template/iam-instance-profile_test.rb +4 -3
- data/test/template/iam-user_test.rb +54 -0
- data/test/template/output-access-key_test.rb +2 -2
- data/test/template/{output-iam-instance-profile_test.rb → output-instance-profile_test.rb} +2 -2
- data/test/template/output-network-interface_test.rb +39 -0
- data/test/template/{output-iam-role_test.rb → output-role_test.rb} +2 -2
- data/test/template/{output-ec2-subet_test.rb → output-subet_test.rb} +2 -2
- data/test/template/rds-db-instance_test.rb +5 -5
- data/test/template/s3-bucket_test.rb +60 -0
- metadata +66 -16
- data/Gemfile.lock +0 -51
@@ -0,0 +1,52 @@
|
|
1
|
+
require 'abstract_unit'
|
2
|
+
|
3
|
+
class Ec2NetworkInterfaceTest < Minitest::Test
|
4
|
+
def test_normal
|
5
|
+
template = <<-EOS
|
6
|
+
_ec2_network_interface "test", ref_subnet: "test"
|
7
|
+
EOS
|
8
|
+
act_template = run_client_as_json(template)
|
9
|
+
exp_template = <<-EOS
|
10
|
+
{
|
11
|
+
"TestNetworkInterface": {
|
12
|
+
"Type": "AWS::EC2::NetworkInterface",
|
13
|
+
"Properties": {
|
14
|
+
"SourceDestCheck": "false",
|
15
|
+
"SubnetId": {
|
16
|
+
"Ref": "TestSubnet"
|
17
|
+
},
|
18
|
+
"Tags": [
|
19
|
+
{
|
20
|
+
"Key": "Name",
|
21
|
+
"Value": {
|
22
|
+
"Fn::Join": [
|
23
|
+
"-",
|
24
|
+
[
|
25
|
+
{
|
26
|
+
"Ref": "Service"
|
27
|
+
},
|
28
|
+
"test"
|
29
|
+
]
|
30
|
+
]
|
31
|
+
}
|
32
|
+
},
|
33
|
+
{
|
34
|
+
"Key": "Service",
|
35
|
+
"Value": {
|
36
|
+
"Ref": "Service"
|
37
|
+
}
|
38
|
+
},
|
39
|
+
{
|
40
|
+
"Key": "Version",
|
41
|
+
"Value": {
|
42
|
+
"Ref": "Version"
|
43
|
+
}
|
44
|
+
}
|
45
|
+
]
|
46
|
+
}
|
47
|
+
}
|
48
|
+
}
|
49
|
+
EOS
|
50
|
+
assert_equal exp_template.chomp, act_template
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'abstract_unit'
|
2
|
+
|
3
|
+
class Ec2PlacementGroupTest < Minitest::Test
|
4
|
+
def test_normal
|
5
|
+
template = <<-EOS
|
6
|
+
_ec2_placement_group "test"
|
7
|
+
EOS
|
8
|
+
act_template = run_client_as_json(template)
|
9
|
+
exp_template = <<-EOS
|
10
|
+
{
|
11
|
+
"TestPlacementGroup": {
|
12
|
+
"Type": "AWS::EC2::PlacementGroup",
|
13
|
+
"Properties": {
|
14
|
+
"Strategy": "cluster"
|
15
|
+
}
|
16
|
+
}
|
17
|
+
}
|
18
|
+
EOS
|
19
|
+
assert_equal exp_template.chomp, act_template
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'abstract_unit'
|
2
|
+
|
3
|
+
class Ec2SecurityGroupEgressTest < Minitest::Test
|
4
|
+
def test_normal
|
5
|
+
template = <<-EOS
|
6
|
+
_ec2_security_group_egress "test", group: "test", to: 80
|
7
|
+
EOS
|
8
|
+
act_template = run_client_as_json(template)
|
9
|
+
exp_template = <<-EOS
|
10
|
+
{
|
11
|
+
"TestSecurityGroupEgress": {
|
12
|
+
"Type": "AWS::EC2::SecurityGroupEgress",
|
13
|
+
"Properties": {
|
14
|
+
"CidrIp": "0.0.0.0/0",
|
15
|
+
"FromPort": "80",
|
16
|
+
"IpProtocol": "tcp",
|
17
|
+
"ToPort": "80",
|
18
|
+
"GroupId": "test"
|
19
|
+
}
|
20
|
+
}
|
21
|
+
}
|
22
|
+
EOS
|
23
|
+
assert_equal exp_template.chomp, act_template
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'abstract_unit'
|
2
|
+
|
3
|
+
class Ec2SecurityGroupIngressTest < Minitest::Test
|
4
|
+
def test_normal
|
5
|
+
template = <<-EOS
|
6
|
+
_ec2_security_group_ingress "test", from: 80
|
7
|
+
EOS
|
8
|
+
act_template = run_client_as_json(template)
|
9
|
+
exp_template = <<-EOS
|
10
|
+
{
|
11
|
+
"TestSecurityGroupIngress": {
|
12
|
+
"Type": "AWS::EC2::SecurityGroupIngress",
|
13
|
+
"Properties": {
|
14
|
+
"CidrIp": "0.0.0.0/0",
|
15
|
+
"FromPort": "80",
|
16
|
+
"IpProtocol": "tcp",
|
17
|
+
"ToPort": "80",
|
18
|
+
"GroupName": "test"
|
19
|
+
}
|
20
|
+
}
|
21
|
+
}
|
22
|
+
EOS
|
23
|
+
assert_equal exp_template.chomp, act_template
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'abstract_unit'
|
2
|
+
|
3
|
+
class Ec2SubnetCidrBlockTest < Minitest::Test
|
4
|
+
def test_normal
|
5
|
+
template = <<-EOS
|
6
|
+
_ec2_subnet_cidr_block "test", ref_cidr: "test", ref_subnet: "test"
|
7
|
+
EOS
|
8
|
+
act_template = run_client_as_json(template)
|
9
|
+
exp_template = <<-EOS
|
10
|
+
{
|
11
|
+
"TestSubnetCidrBlock": {
|
12
|
+
"Type": "AWS::EC2::SubnetCidrBlock",
|
13
|
+
"Properties": {
|
14
|
+
"Ipv6CidrBlock": {
|
15
|
+
"Ref": "TestCidr"
|
16
|
+
},
|
17
|
+
"SubnetId": {
|
18
|
+
"Ref": "TestSubnet"
|
19
|
+
}
|
20
|
+
}
|
21
|
+
}
|
22
|
+
}
|
23
|
+
EOS
|
24
|
+
assert_equal exp_template.chomp, act_template
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'abstract_unit'
|
2
|
+
|
3
|
+
class Ec2VpcCidrBlockTest < Minitest::Test
|
4
|
+
def test_normal
|
5
|
+
template = <<-EOS
|
6
|
+
_ec2_vpc_cidr_block "test", ref_vpc: "test"
|
7
|
+
EOS
|
8
|
+
act_template = run_client_as_json(template)
|
9
|
+
exp_template = <<-EOS
|
10
|
+
{
|
11
|
+
"TestVpcCidrBlock": {
|
12
|
+
"Type": "AWS::EC2::VPCCidrBlock",
|
13
|
+
"Properties": {
|
14
|
+
"AmazonProvidedIpv6CidrBlock": "true",
|
15
|
+
"VpcId": {
|
16
|
+
"Ref": "TestVpc"
|
17
|
+
}
|
18
|
+
}
|
19
|
+
}
|
20
|
+
}
|
21
|
+
EOS
|
22
|
+
assert_equal exp_template.chomp, act_template
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'abstract_unit'
|
2
|
+
|
3
|
+
class Ec2VpcDhcpOptionsAssociationTest < Minitest::Test
|
4
|
+
def test_normal
|
5
|
+
template = <<-EOS
|
6
|
+
_ec2_vpc_dhcp_options_association "test", ref_dhcp: "test", ref_vpc: "test"
|
7
|
+
EOS
|
8
|
+
act_template = run_client_as_json(template)
|
9
|
+
exp_template = <<-EOS
|
10
|
+
{
|
11
|
+
"TestVpcDhcpOptionsAssociation": {
|
12
|
+
"Type": "AWS::EC2::VPCDHCPOptionsAssociation",
|
13
|
+
"Properties": {
|
14
|
+
"DhcpOptionsId": {
|
15
|
+
"Ref": "TestDhcpOptions"
|
16
|
+
},
|
17
|
+
"VpcId": {
|
18
|
+
"Ref": "TestVpc"
|
19
|
+
}
|
20
|
+
}
|
21
|
+
}
|
22
|
+
}
|
23
|
+
EOS
|
24
|
+
assert_equal exp_template.chomp, act_template
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
require 'abstract_unit'
|
2
|
+
|
3
|
+
class Ec2VpcPeeringConnectionTest < Minitest::Test
|
4
|
+
def test_normal
|
5
|
+
template = <<-EOS
|
6
|
+
_ec2_vpc_peering_connection "test", ref_peer_vpc: "test", ref_vpc: "test"
|
7
|
+
EOS
|
8
|
+
act_template = run_client_as_json(template)
|
9
|
+
exp_template = <<-EOS
|
10
|
+
{
|
11
|
+
"TestVpcPeeringConnection": {
|
12
|
+
"Type": "AWS::EC2::VPCPeeringConnection",
|
13
|
+
"Properties": {
|
14
|
+
"PeerVpcId": {
|
15
|
+
"Ref": "TestVpc"
|
16
|
+
},
|
17
|
+
"Tags": [
|
18
|
+
{
|
19
|
+
"Key": "Name",
|
20
|
+
"Value": {
|
21
|
+
"Fn::Join": [
|
22
|
+
"-",
|
23
|
+
[
|
24
|
+
{
|
25
|
+
"Ref": "Service"
|
26
|
+
},
|
27
|
+
"test"
|
28
|
+
]
|
29
|
+
]
|
30
|
+
}
|
31
|
+
},
|
32
|
+
{
|
33
|
+
"Key": "Service",
|
34
|
+
"Value": {
|
35
|
+
"Ref": "Service"
|
36
|
+
}
|
37
|
+
},
|
38
|
+
{
|
39
|
+
"Key": "Version",
|
40
|
+
"Value": {
|
41
|
+
"Ref": "Version"
|
42
|
+
}
|
43
|
+
}
|
44
|
+
],
|
45
|
+
"VpcId": {
|
46
|
+
"Ref": "TestVpc"
|
47
|
+
}
|
48
|
+
}
|
49
|
+
}
|
50
|
+
}
|
51
|
+
EOS
|
52
|
+
assert_equal exp_template.chomp, act_template
|
53
|
+
end
|
54
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'abstract_unit'
|
2
|
+
|
3
|
+
class Ec2VpnConnectionRouteTest < Minitest::Test
|
4
|
+
def test_normal
|
5
|
+
template = <<-EOS
|
6
|
+
_ec2_vpn_connection_route "test", ref_cidr: "test", ref_vpn: "test"
|
7
|
+
EOS
|
8
|
+
act_template = run_client_as_json(template)
|
9
|
+
exp_template = <<-EOS
|
10
|
+
{
|
11
|
+
"TestVpnConnectionRoute": {
|
12
|
+
"Type": "AWS::EC2::VPNConnectionRoute",
|
13
|
+
"Properties": {
|
14
|
+
"DestinationCidrBlock": {
|
15
|
+
"Ref": "TestCidr"
|
16
|
+
},
|
17
|
+
"VpnConnectionId": {
|
18
|
+
"Ref": "TestVpnConnection"
|
19
|
+
}
|
20
|
+
}
|
21
|
+
}
|
22
|
+
}
|
23
|
+
EOS
|
24
|
+
assert_equal exp_template.chomp, act_template
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
require 'abstract_unit'
|
2
|
+
|
3
|
+
class Ec2VpnConnectionTest < Minitest::Test
|
4
|
+
def test_normal
|
5
|
+
template = <<-EOS
|
6
|
+
_ec2_vpn_connection "test", type: "test", ref_customer: "test", ref_vpn: "test"
|
7
|
+
EOS
|
8
|
+
act_template = run_client_as_json(template)
|
9
|
+
exp_template = <<-EOS
|
10
|
+
{
|
11
|
+
"TestVpnConnection": {
|
12
|
+
"Type": "AWS::EC2::VPNConnection",
|
13
|
+
"Properties": {
|
14
|
+
"Type": "test",
|
15
|
+
"CustomerGatewayId": {
|
16
|
+
"Ref": "TestCustomerGateway"
|
17
|
+
},
|
18
|
+
"StaticRoutesOnly": "true",
|
19
|
+
"Tags": [
|
20
|
+
{
|
21
|
+
"Key": "Name",
|
22
|
+
"Value": {
|
23
|
+
"Fn::Join": [
|
24
|
+
"-",
|
25
|
+
[
|
26
|
+
{
|
27
|
+
"Ref": "Service"
|
28
|
+
},
|
29
|
+
"test"
|
30
|
+
]
|
31
|
+
]
|
32
|
+
}
|
33
|
+
},
|
34
|
+
{
|
35
|
+
"Key": "Service",
|
36
|
+
"Value": {
|
37
|
+
"Ref": "Service"
|
38
|
+
}
|
39
|
+
},
|
40
|
+
{
|
41
|
+
"Key": "Version",
|
42
|
+
"Value": {
|
43
|
+
"Ref": "Version"
|
44
|
+
}
|
45
|
+
}
|
46
|
+
],
|
47
|
+
"VpnGatewayId": {
|
48
|
+
"Ref": "TestVpnGateway"
|
49
|
+
}
|
50
|
+
}
|
51
|
+
}
|
52
|
+
}
|
53
|
+
EOS
|
54
|
+
assert_equal exp_template.chomp, act_template
|
55
|
+
end
|
56
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
require 'abstract_unit'
|
2
|
+
|
3
|
+
class Ec2VpnGatewayRoutePropagationTest < Minitest::Test
|
4
|
+
def test_normal
|
5
|
+
template = <<-EOS
|
6
|
+
_ec2_vpn_gateway_route_propagation "test", ref_routes: [ "test" ], ref_vpn: "test"
|
7
|
+
EOS
|
8
|
+
act_template = run_client_as_json(template)
|
9
|
+
exp_template = <<-EOS
|
10
|
+
{
|
11
|
+
"TestVpnGatewayRoutePropagation": {
|
12
|
+
"Type": "AWS::EC2::VPNGatewayRoutePropagation",
|
13
|
+
"Properties": {
|
14
|
+
"RouteTableIds": [
|
15
|
+
{
|
16
|
+
"Ref": "TestRouteTable"
|
17
|
+
}
|
18
|
+
],
|
19
|
+
"VpnGatewayId": {
|
20
|
+
"Ref": "TestVpnGateway"
|
21
|
+
}
|
22
|
+
}
|
23
|
+
}
|
24
|
+
}
|
25
|
+
EOS
|
26
|
+
assert_equal exp_template.chomp, act_template
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
require 'abstract_unit'
|
2
|
+
|
3
|
+
class Ec2VpnGatewayTest < Minitest::Test
|
4
|
+
def test_normal
|
5
|
+
template = <<-EOS
|
6
|
+
_ec2_vpn_gateway "test", type: "test"
|
7
|
+
EOS
|
8
|
+
act_template = run_client_as_json(template)
|
9
|
+
exp_template = <<-EOS
|
10
|
+
{
|
11
|
+
"TestVpnGateway": {
|
12
|
+
"Type": "AWS::EC2::VPNGateway",
|
13
|
+
"Properties": {
|
14
|
+
"Type": "test",
|
15
|
+
"Tags": [
|
16
|
+
{
|
17
|
+
"Key": "Name",
|
18
|
+
"Value": {
|
19
|
+
"Fn::Join": [
|
20
|
+
"-",
|
21
|
+
[
|
22
|
+
{
|
23
|
+
"Ref": "Service"
|
24
|
+
},
|
25
|
+
"test"
|
26
|
+
]
|
27
|
+
]
|
28
|
+
}
|
29
|
+
},
|
30
|
+
{
|
31
|
+
"Key": "Service",
|
32
|
+
"Value": {
|
33
|
+
"Ref": "Service"
|
34
|
+
}
|
35
|
+
},
|
36
|
+
{
|
37
|
+
"Key": "Version",
|
38
|
+
"Value": {
|
39
|
+
"Ref": "Version"
|
40
|
+
}
|
41
|
+
}
|
42
|
+
]
|
43
|
+
}
|
44
|
+
}
|
45
|
+
}
|
46
|
+
EOS
|
47
|
+
assert_equal exp_template.chomp, act_template
|
48
|
+
end
|
49
|
+
end
|
@@ -3,7 +3,7 @@ require 'abstract_unit'
|
|
3
3
|
class IamInstacenProfileTest < Minitest::Test
|
4
4
|
def test_normal
|
5
5
|
template = <<-EOS
|
6
|
-
_iam_instance_profile "test",
|
6
|
+
_iam_instance_profile "test", roles: [ "test" ]
|
7
7
|
EOS
|
8
8
|
act_template = run_client_as_json(template)
|
9
9
|
exp_template = <<-EOS
|
@@ -14,7 +14,8 @@ _iam_instance_profile "test", user: "test", roles: [ "test" ]
|
|
14
14
|
"Path": "/",
|
15
15
|
"Roles": [
|
16
16
|
"test"
|
17
|
-
]
|
17
|
+
],
|
18
|
+
"InstanceProfileName": "test"
|
18
19
|
}
|
19
20
|
}
|
20
21
|
}
|
@@ -22,7 +23,7 @@ _iam_instance_profile "test", user: "test", roles: [ "test" ]
|
|
22
23
|
assert_equal exp_template.chomp, act_template
|
23
24
|
|
24
25
|
template = <<-EOS
|
25
|
-
_iam_instance_profile "test",
|
26
|
+
_iam_instance_profile "test", profile: "test", roles: [ "test" ], profile_name: "test"
|
26
27
|
EOS
|
27
28
|
act_template = run_client_as_json(template)
|
28
29
|
exp_template = <<-EOS
|
@@ -15,6 +15,60 @@ _iam_user "test"
|
|
15
15
|
"UserName": "test"
|
16
16
|
}
|
17
17
|
}
|
18
|
+
}
|
19
|
+
EOS
|
20
|
+
assert_equal exp_template.chomp, act_template
|
21
|
+
end
|
22
|
+
|
23
|
+
def test_name
|
24
|
+
template = <<-EOS
|
25
|
+
_iam_user "test", user: "test 1"
|
26
|
+
EOS
|
27
|
+
act_template = run_client_as_json(template)
|
28
|
+
exp_template = <<-EOS
|
29
|
+
{
|
30
|
+
"TestUser": {
|
31
|
+
"Type": "AWS::IAM::User",
|
32
|
+
"Properties": {
|
33
|
+
"Path": "/",
|
34
|
+
"UserName": "test-1"
|
35
|
+
}
|
36
|
+
}
|
37
|
+
}
|
38
|
+
EOS
|
39
|
+
assert_equal exp_template.chomp, act_template
|
40
|
+
|
41
|
+
template = <<-EOS
|
42
|
+
_iam_user "test", ref_user: "test"
|
43
|
+
EOS
|
44
|
+
act_template = run_client_as_json(template)
|
45
|
+
exp_template = <<-EOS
|
46
|
+
{
|
47
|
+
"TestUser": {
|
48
|
+
"Type": "AWS::IAM::User",
|
49
|
+
"Properties": {
|
50
|
+
"Path": "/",
|
51
|
+
"UserName": {
|
52
|
+
"Ref": "Test"
|
53
|
+
}
|
54
|
+
}
|
55
|
+
}
|
56
|
+
}
|
57
|
+
EOS
|
58
|
+
assert_equal exp_template.chomp, act_template
|
59
|
+
|
60
|
+
template = <<-EOS
|
61
|
+
_iam_user "test", user: false
|
62
|
+
EOS
|
63
|
+
act_template = run_client_as_json(template)
|
64
|
+
exp_template = <<-EOS
|
65
|
+
{
|
66
|
+
"TestUser": {
|
67
|
+
"Type": "AWS::IAM::User",
|
68
|
+
"Properties": {
|
69
|
+
"Path": "/"
|
70
|
+
}
|
71
|
+
}
|
18
72
|
}
|
19
73
|
EOS
|
20
74
|
assert_equal exp_template.chomp, act_template
|
@@ -11,14 +11,14 @@ _output_access_key "test"
|
|
11
11
|
"TestAccessKey": {
|
12
12
|
"Description": "description of TestAccessKey",
|
13
13
|
"Value": {
|
14
|
-
"Ref": "
|
14
|
+
"Ref": "TestAccessKey"
|
15
15
|
}
|
16
16
|
},
|
17
17
|
"TestSecretAccessKey": {
|
18
18
|
"Description": "description of TestSecretAccessKey",
|
19
19
|
"Value": {
|
20
20
|
"Fn::GetAtt": [
|
21
|
-
"
|
21
|
+
"TestAccessKey",
|
22
22
|
"SecretAccessKey"
|
23
23
|
]
|
24
24
|
}
|
@@ -1,9 +1,9 @@
|
|
1
1
|
require 'abstract_unit'
|
2
2
|
|
3
|
-
class
|
3
|
+
class OutputInstancerProfileTest < Minitest::Test
|
4
4
|
def test_normal
|
5
5
|
template = <<-EOS
|
6
|
-
|
6
|
+
_output_instance_profile "test"
|
7
7
|
EOS
|
8
8
|
act_template = run_client_as_json(template)
|
9
9
|
exp_template = <<-EOS
|
@@ -0,0 +1,39 @@
|
|
1
|
+
require 'abstract_unit'
|
2
|
+
|
3
|
+
class OutputNetworkInterfaceTest < Minitest::Test
|
4
|
+
def test_normal
|
5
|
+
template = <<-EOS
|
6
|
+
_output_network_interface "test"
|
7
|
+
EOS
|
8
|
+
act_template = run_client_as_json(template)
|
9
|
+
exp_template = <<-EOS
|
10
|
+
{
|
11
|
+
"TestNetworkInterface": {
|
12
|
+
"Description": "description of TestNetworkInterface",
|
13
|
+
"Value": {
|
14
|
+
"Ref": "TestNetworkInterface"
|
15
|
+
}
|
16
|
+
},
|
17
|
+
"TestNetworkInterfacePrivateIp": {
|
18
|
+
"Description": "description of TestNetworkInterfacePrivateIp",
|
19
|
+
"Value": {
|
20
|
+
"Fn::GetAtt": [
|
21
|
+
"TestNetworkInterface",
|
22
|
+
"PrimaryPrivateIpAddress"
|
23
|
+
]
|
24
|
+
}
|
25
|
+
},
|
26
|
+
"TestNetworkInterfaceSecondaryIps": {
|
27
|
+
"Description": "description of TestNetworkInterfaceSecondaryIps",
|
28
|
+
"Value": {
|
29
|
+
"Fn::GetAtt": [
|
30
|
+
"TestNetworkInterface",
|
31
|
+
"SecondaryPrivateIpAddresses"
|
32
|
+
]
|
33
|
+
}
|
34
|
+
}
|
35
|
+
}
|
36
|
+
EOS
|
37
|
+
assert_equal exp_template.chomp, act_template
|
38
|
+
end
|
39
|
+
end
|
@@ -1,9 +1,9 @@
|
|
1
1
|
require 'abstract_unit'
|
2
2
|
|
3
|
-
class
|
3
|
+
class OutputRoleTest < Minitest::Test
|
4
4
|
def test_normal
|
5
5
|
template = <<-EOS
|
6
|
-
|
6
|
+
_output_role "test"
|
7
7
|
EOS
|
8
8
|
act_template = run_client_as_json(template)
|
9
9
|
exp_template = <<-EOS
|
@@ -1,9 +1,9 @@
|
|
1
1
|
require 'abstract_unit'
|
2
2
|
|
3
|
-
class
|
3
|
+
class OutputSubnetTest < Minitest::Test
|
4
4
|
def test_normal
|
5
5
|
template = <<-EOS
|
6
|
-
|
6
|
+
_output_subnet "test"
|
7
7
|
EOS
|
8
8
|
act_template = run_client_as_json(template)
|
9
9
|
exp_template = <<-EOS
|