Beispiel #1
0
def virtual_network(stem, address_spaces):
    vn = network.VirtualNetwork(
        f'{stem}{s}vn',
        virtual_network_name=f'{stem}{s}vn{s}{suffix}',
        resource_group_name=resource_group_name,
        location=location,
        address_space=network.AddressSpaceArgs(
            address_prefixes=address_spaces, ),
        tags=tags,
        opts=ResourceOptions(parent=self),
    )
    return vn
Beispiel #2
0

private_key = config.require_secret('privateKey').apply(decode_key)
private_key_passphrase = config.get_secret('privateKeyPassphrase')

# Create a resource group to hold project resources.
resource_group = resources.ResourceGroup("server-rg",
                                         resource_group_name="minecraft",
                                         location=location)

# Create a virtual network resource.
net = network.VirtualNetwork("server-network",
                             resource_group_name=resource_group.name,
                             location=location,
                             virtual_network_name="server-network",
                             address_space=network.AddressSpaceArgs(
                                 address_prefixes=["10.0.0.0/16"], ),
                             subnets=[
                                 network.SubnetArgs(
                                     name="default",
                                     address_prefix="10.0.0.0/24",
                                 )
                             ])

# Create a public IP to enable access on the Internet.
public_ip = network.PublicIPAddress("server-ip",
                                    resource_group_name=resource_group.name,
                                    location=location,
                                    public_ip_address_name="server-ip",
                                    public_ip_allocation_method="Dynamic")

# Create the network interface for the server.
Beispiel #3
0
    resource_group_name=resource_group.name,
    location=location,
    access_tier="Hot",
    enable_https_traffic_only=True,
    allow_blob_public_access=False,
    kind="StorageV2",
    sku=storage.SkuArgs(name="Standard_LRS", ))

net = network.VirtualNetwork(
    resource_name='vnet-nc',
    resource_group_name=resource_group.name,
    virtual_network_name='vnet-nc-{0}'.format(installation_id),
    location=resource_group.location,
    enable_ddos_protection=False,
    enable_vm_protection=False,
    address_space=network.AddressSpaceArgs(address_prefixes=['10.0.0.0/16']))

subnet = network.Subnet(resource_name='snet-nc',
                        resource_group_name=resource_group.name,
                        virtual_network_name=net.name,
                        subnet_name='snet-nc-{0}'.format(installation_id),
                        service_endpoints=[
                            network.ServiceEndpointPropertiesFormatArgs(
                                locations=[location],
                                service='Microsoft.Sql',
                            )
                        ],
                        address_prefix="10.0.2.0/24",
                        private_endpoint_network_policies="Disabled",
                        private_link_service_network_policies="Enabled",
                        opts=ResourceOptions(depends_on=[net]))