Exemplo n.º 1
0
 def ref_redirect_configuration(
         self,
         value: ApplicationGatewayRedirectConfiguration) -> SubResource:
     return SubResource(
         id=
         f"[resourceId('{self.resource_type}/redirectConfigurations', '{self.title}', '{value.title}')]"
     )
Exemplo n.º 2
0
    def test_private_dns(self):
        sandbox = '654321'
        vnet_name = '{}_vnet'.format(sandbox)
        dns_name = '{}.sandbox.com'.format(sandbox)

        template = ARMTemplate()

        vnet = VirtualNetwork(vnet_name, template=template)

        nic = NetworkInterface('testNic')

        dns = DnsZone(dns_name,
                      template=template,
                      registrationVirtualNetworks=[SubResource(id=vnet.ref())],
                      zoneType=ZoneType.Private.name,
                      dependsOn=vnet)

        dns_a = DnsZoneA(
            '/'.join([dns_name, 'app1']),
            template=template,
            TTL=3600,
            ARecords=[
                ARecord(
                    ipv4Address=
                    "[reference('crumbNIC').ipConfigurations[0].properties.privateIPAddress]"
                )
            ],
            dependsOn=dns)

        j = template.to_json()

        print(j)
Exemplo n.º 3
0
 def ref_ssl_certificate(
         self, value: ApplicationGatewaySslCertificate) -> SubResource:
     return SubResource(
         id=
         f"[resourceId('{self.resource_type}/sslCertificates', '{self.title}', '{value.title}')]"
     )
Exemplo n.º 4
0
 def ref_health_probe(self,
                      value: ApplicationGatewayHealthProbe) -> SubResource:
     return SubResource(
         id=
         f"[resourceId('{self.resource_type}/probes', '{self.title}', '{value.title}')]"
     )
Exemplo n.º 5
0
 def ref_url_path_map(self,
                      value: ApplicationGatewayUrlPathMap) -> SubResource:
     return SubResource(
         id=
         f"[resourceId('{self.resource_type}/urlPathMaps', '{self.title}', '{value.title}')]"
     )
Exemplo n.º 6
0
 def ref_http_listener(
         self, value: ApplicationGatewayHttpListener) -> SubResource:
     return SubResource(
         id=
         f"[resourceId('{self.resource_type}/httpListeners', '{self.title}', '{value.title}')]"
     )
Exemplo n.º 7
0
 def ref_backend_http_settings(
         self, value: ApplicationGatewayBackendHttpSettings) -> SubResource:
     return SubResource(
         id=
         f"[resourceId('{self.resource_type}/backendHttpSettingsCollection', '{self.title}', '{value.title}')]"
     )
Exemplo n.º 8
0
 def ref_backend_address_pool(self,
                              value: BackendAddressPool) -> SubResource:
     return SubResource(
         id=
         f"[resourceId('{self.resource_type}/backendAddressPools', '{self.title}', '{value.title}')]"
     )
Exemplo n.º 9
0
 def ref_frontend_port(
         self, value: ApplicationGatewayFrontendPort) -> SubResource:
     return SubResource(
         id=
         f"[resourceId('{self.resource_type}/frontendPorts', '{self.title}', '{value.title}')]"
     )
Exemplo n.º 10
0
 def ref_frontend_ip_configuration(
         self, value: FrontendIPConfiguration) -> SubResource:
     return SubResource(
         id=
         f"[resourceId('{self.resource_type}/frontendIPConfigurations', '{self.title}', '{value.title}')]"
     )
Exemplo n.º 11
0
 def ref_gateway_ip_configuration(
         self, value: ApplicationGatewayIPConfiguration) -> SubResource:
     return SubResource(
         id=
         f"[resourceId('{self.resource_type}/gatewayIPConfigurations', '{self.title}', '{value.title}')]"
     )
Exemplo n.º 12
0
 def ref_probe(self, value: Probe) -> SubResource:
     return SubResource(
         id=
         f"[resourceId('{self.resource_type}/probes', '{self.title}', '{value.title}')]"
     )