Esempio n. 1
0
 def test_jarombek_com_yeezus_public_subnet_configured(self) -> None:
     """
     Determine if the jarombek-com-yeezus-public-subnet is configured and available as expected.
     """
     vpc = VPC.get_vpcs('jarombek-com-vpc')[0]
     subnet = VPC.get_subnets('jarombek-com-yeezus-public-subnet')[0]
 
     self.assertTrue(VPC.subnet_configured(vpc, subnet, 'us-east-1a', '10.0.1.0/24'))
Esempio n. 2
0
 def test_jarombek_com_reputation_private_subnet_configured(self) -> None:
     """
     Determine if the jarombek-com-reputation-private-subnet is configured and available as expected.
     """
     vpc = VPC.get_vpcs('jarombek-com-vpc')[0]
     subnet = VPC.get_subnets('jarombek-com-reputation-private-subnet')[0]
 
     self.assertTrue(VPC.subnet_configured(vpc, subnet, 'us-east-1d', '10.0.4.0/24'))
Esempio n. 3
0
    def test_application_lisag_public_subnet_configured(self) -> None:
        """
        Determine if the saints-xctf-com-lisag-public-subnet is configured and available as expected.
        """
        vpc = VPC.get_vpcs('application-vpc')[0]
        subnet = VPC.get_subnets('saints-xctf-com-lisag-public-subnet')[0]

        self.assertTrue(
            VPC.subnet_configured(vpc, subnet, 'us-east-1b', '10.0.1.0/24'))
Esempio n. 4
0
    def test_kubernetes_dotty_public_subnet_configured(self) -> None:
        """
        Determine if the kubernetes dotty public Subnet is configured and available as expected.
        """
        vpc = VPC.get_vpcs('application-vpc')[0]
        subnet = VPC.get_subnets('kubernetes-dotty-public-subnet')[0]

        self.assertTrue(
            VPC.subnet_configured(vpc, subnet, 'us-east-1b', '10.0.6.0/24'))
Esempio n. 5
0
    def test_application_carolined_private_subnet_configured(self) -> None:
        """
        Determine if the saint-sxctf-com-carolined-private-subnet is configured and available as expected.
        """
        vpc = VPC.get_vpcs('application-vpc')[0]
        subnet = VPC.get_subnets('saints-xctf-com-carolined-private-subnet')[0]

        self.assertTrue(
            VPC.subnet_configured(vpc, subnet, 'us-east-1c', '10.0.4.0/24'))
Esempio n. 6
0
    def test_sandbox_fearless_public_subnet_configured(self) -> None:
        """
        Determine if the sandbox 'fearless' public Subnet is configured and available as expected.
        """
        vpc = VPC.get_vpcs('sandbox-vpc')[0]
        subnet = VPC.get_subnets('sandbox-vpc-fearless-public-subnet')[0]

        self.assertTrue(
            VPC.subnet_configured(vpc, subnet, 'us-east-1a', '10.2.1.0/24'))
Esempio n. 7
0
    def test_kubernetes_grandmas_blanket_public_subnet_configured(
            self) -> None:
        """
        Determine if the kubernetes grandmas blanket public Subnet is configured and available as expected.
        """
        vpc = VPC.get_vpcs('application-vpc')[0]
        subnet = VPC.get_subnets(
            'kubernetes-grandmas-blanket-public-subnet')[0]

        self.assertTrue(
            VPC.subnet_configured(vpc, subnet, 'us-east-1a', '10.0.5.0/24'))
Esempio n. 8
0
    def test_application_lisag_public_subnet_rt_configured(self) -> None:
        """
        Determine if the saints-xctf-com-lisag-public-subnet routing table is configured and available as expected.
        """
        vpc = VPC.get_vpcs('application-vpc')[0]
        subnet = VPC.get_subnets('saints-xctf-com-lisag-public-subnet')[0]
        route_table = VPC.get_route_table(
            'application-vpc-public-subnet-rt')[0]
        internet_gateway = VPC.get_internet_gateways(
            'application-vpc-internet-gateway')[0]

        self.assertTrue(
            VPC.route_table_configured(
                route_table, vpc.get('VpcId'), subnet.get('SubnetId'),
                internet_gateway.get('InternetGatewayId')))
Esempio n. 9
0
 def test_jarombek_com_yeezus_public_subnet_rt_configured(self) -> None:
     """
     Determine if the jarombek-com-yeezus-public-subnet routing table is configured and available as expected.
     """
     vpc = VPC.get_vpcs('jarombek-com-vpc')[0]
     subnet = VPC.get_subnets('jarombek-com-yeezus-public-subnet')[0]
     route_table = VPC.get_route_table('jarombek-com-vpc-public-subnet-rt')[0]
     internet_gateway = VPC.get_internet_gateways('jarombek-com-vpc-internet-gateway')[0]
 
     self.assertTrue(VPC.route_table_configured(
         route_table,
         vpc.get('VpcId'),
         subnet.get('SubnetId'),
         internet_gateway.get('InternetGatewayId')
     ))
Esempio n. 10
0
 def test_kubernetes_grandmas_blanket_public_subnet_exists(self) -> None:
     """
     Determine if the kubernetes-grandmas-blanket-public-subnet exists
     """
     self.assertTrue(
         len(VPC.get_subnets('kubernetes-grandmas-blanket-public-subnet'))
         == 1)
Esempio n. 11
0
 def test_application_carolined_private_subnet_exists(self) -> None:
     """
     Determine if the saints-xctf-com-carolined-private-subnet exists
     """
     self.assertTrue(
         len(VPC.get_subnets('saints-xctf-com-carolined-private-subnet')) ==
         1)
Esempio n. 12
0
 def test_sandbox_internet_gateway_exists(self) -> None:
     """
     Determine if the sandbox-vpc-internet-gateway exists
     """
     self.assertTrue(
         len(VPC.get_internet_gateways('sandbox-vpc-internet-gateway')) ==
         1)
Esempio n. 13
0
 def test_application_internet_gateway_exists(self) -> None:
     """
     Determine if the application-vpc-internet-gateway exists
     """
     self.assertTrue(
         len(VPC.get_internet_gateways('application-vpc-internet-gateway'))
         == 1)
Esempio n. 14
0
    def test_sandbox_fearless_public_subnet_rt_configured(self) -> None:
        """
        Determine if the sandbox 'fearless' public subnet routing table is configured and available as expected.
        """
        vpc = VPC.get_vpcs('sandbox-vpc')[0]
        subnet = VPC.get_subnets('sandbox-vpc-fearless-public-subnet')[0]
        route_table = VPC.get_route_table('sandbox-vpc-public-subnet-rt')[0]
        internet_gateway = VPC.get_internet_gateways(
            'sandbox-vpc-internet-gateway')[0]

        self.assertTrue(
            VPC.route_table_configured(
                route_table=route_table,
                vpc_id=vpc.get('VpcId'),
                subnet_id=subnet.get('SubnetId'),
                igw_id=internet_gateway.get('InternetGatewayId'),
                cidr='10.2.0.0/16'))
Esempio n. 15
0
    def test_kubernetes_dotty_public_subnet_rt_configured(self) -> None:
        """
        Determine if the kubernetes dotty public subnet routing table is configured and available as expected.
        """
        vpc = VPC.get_vpcs('application-vpc')[0]
        subnet = VPC.get_subnets('kubernetes-dotty-public-subnet')[0]
        route_table = VPC.get_route_table(
            'application-vpc-public-subnet-rt')[0]
        internet_gateway = VPC.get_internet_gateways(
            'application-vpc-internet-gateway')[0]

        self.assertTrue(
            VPC.route_table_configured(
                route_table=route_table,
                vpc_id=vpc.get('VpcId'),
                subnet_id=subnet.get('SubnetId'),
                igw_id=internet_gateway.get('InternetGatewayId'),
                cidr='10.0.0.0/16'))
Esempio n. 16
0
 def test_jenkins_efs_mounted(self) -> None:
     """
     Determine if EFS is mounted in a specific subnet
     """
     efs_id = self.get_efs('jenkins-efs')[0].get('FileSystemId')
     efs_mount_target = self.efs.describe_mount_targets(FileSystemId=efs_id).get('MountTargets')[0]
     subnet_id = VPC.get_subnets('resources-vpc-public-subnet')[0].get('SubnetId')
 
     self.assertTrue(all([
         efs_id == efs_mount_target.get('FileSystemId'),
         efs_mount_target.get('SubnetId') == subnet_id
     ]))
Esempio n. 17
0
    def test_eks_cluster_vpc_subnet(self) -> None:
        """
        Test that the EKS cluster is in the expected cluster and public subnets.
        """
        cluster = self.eks.describe_cluster(name='andrew-jarombek-eks-cluster').get('cluster')
        cluster_vpc: str = cluster.get('resourcesVpcConfig').get('vpcId')
        cluster_subnets: list = cluster.get('resourcesVpcConfig').get('subnetIds')

        kubernetes_vpc = VPC.get_vpcs('application-vpc')
        self.assertEqual(1, len(kubernetes_vpc))

        self.assertEqual(kubernetes_vpc[0].get('VpcId'), cluster_vpc)

        kubernetes_dotty_subnet = VPC.get_subnets('kubernetes-dotty-public-subnet')
        kubernetes_grandmas_blanket_subnet = VPC.get_subnets('kubernetes-grandmas-blanket-public-subnet')
        self.assertEqual(1, len(kubernetes_dotty_subnet))
        self.assertEqual(1, len(kubernetes_grandmas_blanket_subnet))

        self.assertListEqual(
            [kubernetes_dotty_subnet[0].get('SubnetId'), kubernetes_grandmas_blanket_subnet[0].get('SubnetId')],
            cluster_subnets
        )
Esempio n. 18
0
 def test_application_vpc_configured(self) -> None:
     """
     Determine if the application-vpc is configured and available as expected.
     """
     self.assertTrue(VPC.vpc_configured('application-vpc'))
Esempio n. 19
0
 def test_jarombek_com_dns_resolver_exists(self) -> None:
     """
     Determine if the jarombek-com-dhcp-options exists
     """
     self.assertTrue(len(VPC.get_dns_resolvers('jarombek-com-dhcp-options')) == 1)
Esempio n. 20
0
 def test_sandbox_fearless_public_subnet_exists(self) -> None:
     """
     Determine if the sandbox-vpc-fearless-public-subnet exists
     """
     self.assertTrue(
         len(VPC.get_subnets('sandbox-vpc-fearless-public-subnet')) == 1)
Esempio n. 21
0
 def test_sandbox_dns_resolver_exists(self) -> None:
     """
     Determine if the sandbox-dhcp-options exists
     """
     self.assertTrue(
         len(VPC.get_dns_resolvers('sandbox-dhcp-options')) == 1)
Esempio n. 22
0
 def test_sandbox_network_acl_exists(self) -> None:
     """
     Determine if the sandbox-acl exists
     """
     self.assertTrue(len(VPC.get_network_acls('sandbox-acl')) == 1)
Esempio n. 23
0
 def test_jarombek_com_yandhi_public_subnet_exists(self) -> None:
     """
     Determine if the jarombek-com-yandhi-public-subnet exists
     """
     self.assertTrue(len(VPC.get_subnets('jarombek-com-yandhi-public-subnet')) == 1)
Esempio n. 24
0
 def test_sandbox_vpc_configured(self) -> None:
     """
     Determine if the sandbox VPC is configured and available as expected.
     """
     self.assertTrue(
         VPC.vpc_configured(name='sandbox-vpc', cidr='10.2.0.0/16'))
Esempio n. 25
0
 def test_sandbox_vpc_exists(self) -> None:
     """
     Determine if the sandbox-vpc exists
     """
     self.assertTrue(len(VPC.get_vpcs('sandbox-vpc')) == 1)
Esempio n. 26
0
 def test_kubernetes_dotty_public_subnet_exists(self) -> None:
     """
     Determine if the kubernetes-dotty-public-subnet exists
     """
     self.assertTrue(
         len(VPC.get_subnets('kubernetes-dotty-public-subnet')) == 1)
Esempio n. 27
0
 def test_application_vpc_exists(self) -> None:
     """
     Determine if the application-vpc exists
     """
     self.assertTrue(len(VPC.get_vpcs('application-vpc')) == 1)
Esempio n. 28
0
 def test_application_lisag_public_subnet_exists(self) -> None:
     """
     Determine if the saints-xctf-com-lisag-public-subnet exists
     """
     self.assertTrue(
         len(VPC.get_subnets('saints-xctf-com-lisag-public-subnet')) == 1)
Esempio n. 29
0
 def test_application_dns_resolver_exists(self) -> None:
     """
     Determine if the application-dhcp-options exists
     """
     self.assertTrue(
         len(VPC.get_dns_resolvers('application-dhcp-options')) == 1)
Esempio n. 30
0
 def test_application_network_acl_exists(self) -> None:
     """
     Determine if the application-acl exists
     """
     self.assertTrue(len(VPC.get_network_acls('application-acl')) == 1)