tosca_definitions_version: tosca_simple_yaml_1_0

description: Setup the CDN on the pod

imports:
   - custom_types/xos.yaml

topology_template:
  node_templates:

    Private:
      type: tosca.nodes.NetworkTemplate

    management:
      type: tosca.nodes.network.Network.XOS
      properties:
          no-create: true
          no-delete: true
          no-update: true

    cdn-public:
      type: tosca.nodes.network.Network
      properties:
          ip_version: 4
          cidr: 207.141.192.128/28
      requirements:
          - network_template:
              node: Private
              relationship: tosca.relationships.UsesNetworkTemplate
          - owner:
              node: mysite_cdn
              relationship: tosca.relationships.MemberOfSlice
          - connection:
              node: mysite_cdn
              relationship: tosca.relationships.ConnectsToSlice

    mysite:
      type: tosca.nodes.Site

    mysite_cdn:
      description: This slice holds the CDN
      type: tosca.nodes.Slice
      properties:
          network: noauto
      requirements:
          - site:
              node: mysite
              relationship: tosca.relationships.MemberOfSite
          - management:
              node: management
              relationship: tosca.relationships.ConnectsToNetwork

