tb_pulumi.network¶
Infrastructural patterns related to networking.
- class tb_pulumi.network.MultiCidrVpc(name: str, project: ThunderbirdPulumiProject, cidr_block: str = '10.0.0.0/16', egress_via_internet_gateway: bool = False, egress_via_nat_gateway: bool = False, enable_dns_hostnames: bool = None, enable_internet_gateway: bool = False, enable_nat_gateway: bool = False, endpoint_gateways: list[str] = [], endpoint_interfaces: list[str] = [], subnets: dict = {}, opts: ResourceOptions = None, **kwargs)¶
Bases:
ThunderbirdComponentResource
Builds a VPC with configurable network space.
- Parameters:
name (str) – A string identifying this set of resources.
project (tb_pulumi.ThunderbirdPulumiProject) – The ThunderbirdPulumiProject to add these resources to.
cidr_block (str, optional) – A CIDR describing the IP space of this VPC. Defaults to ‘10.0.0.0/16’.
egress_via_internet_gateway (bool, optional) – When True, establish an outbound route to the Internet via the Internet Gateway. Requires
enable_internet_gateway=True
. Conflicts withegress_via_nat_gateway=True
. Defaults to False.egress_via_nat_gateway (bool, optional) – When True, establish an outbound route to the Internet via the NAT Gateway. Requires
enable_nat_gateway=True
. Conflicts withegress_via_internet_gateway=True
. Defaults to False.enable_dns_hostnames (bool, optional) – When True, internal DNS mappings get built for IPs assigned within the VPC. This is required for the use of certain other services like load-balanced Fargate clusters. Defaults to None.
enable_internet_gateway (bool, optional) – Build an IGW will to allow traffic outbond to the Internet. Defaults to False.
enable_nat_gateway (bool, optional) – Build a NAT Gateway to route inbound traffic. Defaults to False.
endpoint_gateways (list[str], optional) – List of public-facing AWS services (such as S3) to create VPC gateways to. Defaults to [].
endpoint_interfaces (list[str], optional) – List of AWS services to create VPC Interface endpoints for. These must match service names listed here Do not list the full qualifying name, only the service name portion. f/ex, do not use
com.amazonaws.us-east-1.secretsmanager
, only usesecretsmanager
. Defaults to [].subnets (dict, optional) –
A dict where the keys are the names of AWS Availability Zones in which to build subnets and the values are lists of CIDRs describing valid subsets of IPs in the VPC
cidr_block
to build in that AZ. f/ex:{ 'us-east-1': ['10.0.100.0/24'], 'us-east-2': ['10.0.101.0/24', '10.0.102.0/24'] }
Defaults to {}.
opts (pulumi.ResourceOptions, optional) – Additional pulumi.ResourceOptions to apply to these resources. Defaults to None.
kwargs – Any other keyword arguments which will be passed as inputs to the ThunderbirdComponentResource superconstructor.
- class tb_pulumi.network.SecurityGroupWithRules(name: str, project: ThunderbirdPulumiProject, rules: dict = {}, vpc_id: str = None, opts: ResourceOptions = None, **kwargs)¶
Bases:
ThunderbirdComponentResource
Builds a security group and sets rules for it.
- Parameters:
name (str) – A string identifying this set of resources.
project (tb_pulumi.ThunderbirdPulumiProject) – The ThunderbirdPulumiProject to add these resources to.
rules (dict, optional) –
A dict describing in/egress rules of the following construction:
{ 'ingress': [{ # Valid inputs to the SecurityGroupRule resource go here. Ref: # https://www.pulumi.com/registry/packages/aws/api-docs/ec2/securitygrouprule/#inputs }], 'egress': [{ # The same inputs are valid here }] }
Defaults to {}.
vpc_id (str, optional) – ID of the VPC this security group should belong to. When not set, defaults to the region’s default VPC. Defaults to None.
opts (pulumi.ResourceOptions, optional) – Additional pulumi.ResourceOptions to apply to these resources. Defaults to None.
kwargs – Any other keyword arguments which will be passed as inputs to the ThunderbirdComponentResource superconstructor.