Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pulumi_azure as azure
- TAGS = {"Project": "dev"}
- rg = azure.core.ResourceGroup(
- "rg",
- name = "zz",
- location = "westeurope",
- tags = TAGS
- )
- vnet = azure.network.VirtualNetwork(
- "vnet",
- resource_group_name=rg.name,
- location=rg.location,
- address_spaces=["10.0.0.0/16"],
- tags = TAGS
- )
- vnet_subnet = azure.network.Subnet(
- "vnet_subnet",
- name="default",
- virtual_network_name=vnet.name,
- resource_group_name=vnet.resource_group_name,
- address_prefixes=["10.0.1.0/24"]
- )
- nsg_subnet = azure.network.NetworkSecurityGroup(
- "nsg_cycle",
- name="nsg_cycle",
- resource_group_name=vnet.resource_group_name,
- location=vnet.location,
- security_rules=[
- azure.network.NetworkSecurityGroupSecurityRuleArgs(
- name="SSH",
- direction="Inbound",
- priority=1000,
- access="Allow",
- protocol="TCP",
- source_port_range="*",
- source_address_prefix="Internet",
- destination_port_ranges=["22"],
- destination_address_prefix="*",
- ),
- ],
- tags = TAGS
- )
- assoc_cycle = azure.network.SubnetNetworkSecurityGroupAssociation(
- "subnet_cycle",
- subnet_id=vnet_subnet.id,
- network_security_group_id=nsg_subnet.id
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement