1. Packages
  2. Edgecenter Provider
  3. API Docs
  4. CdnShielding
edgecenter 0.8.0 published on Wednesday, Apr 30, 2025 by edge-center

edgecenter.CdnShielding

Explore with Pulumi AI

edgecenter logo
edgecenter 0.8.0 published on Wednesday, Apr 30, 2025 by edge-center

    Represent origin shielding

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as edgecenter from "@pulumi/edgecenter";
    
    const sourceGroup1 = new edgecenter.CdnOrigingroup("sourceGroup1", {
        useNext: true,
        origins: [{
            source: "example.com",
            enabled: true,
        }],
    });
    const cdnRes1 = new edgecenter.CdnResource("cdnRes1", {
        cname: "cdn.example.com",
        originGroup: sourceGroup1.cdnOrigingroupId,
    });
    const shieldDc = edgecenter.getCdnShieldingLocation({
        datacenter: "dt",
    });
    const shielding = new edgecenter.CdnShielding("shielding", {
        resourceId: cdnRes1.cdnResourceId,
        shieldingPop: shieldDc.then(shieldDc => shieldDc.id),
    });
    
    import pulumi
    import pulumi_edgecenter as edgecenter
    
    source_group1 = edgecenter.CdnOrigingroup("sourceGroup1",
        use_next=True,
        origins=[{
            "source": "example.com",
            "enabled": True,
        }])
    cdn_res1 = edgecenter.CdnResource("cdnRes1",
        cname="cdn.example.com",
        origin_group=source_group1.cdn_origingroup_id)
    shield_dc = edgecenter.get_cdn_shielding_location(datacenter="dt")
    shielding = edgecenter.CdnShielding("shielding",
        resource_id=cdn_res1.cdn_resource_id,
        shielding_pop=shield_dc.id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/edgecenter/edgecenter"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		sourceGroup1, err := edgecenter.NewCdnOrigingroup(ctx, "sourceGroup1", &edgecenter.CdnOrigingroupArgs{
    			UseNext: pulumi.Bool(true),
    			Origins: edgecenter.CdnOrigingroupOriginArray{
    				&edgecenter.CdnOrigingroupOriginArgs{
    					Source:  pulumi.String("example.com"),
    					Enabled: pulumi.Bool(true),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		cdnRes1, err := edgecenter.NewCdnResource(ctx, "cdnRes1", &edgecenter.CdnResourceArgs{
    			Cname:       pulumi.String("cdn.example.com"),
    			OriginGroup: sourceGroup1.CdnOrigingroupId,
    		})
    		if err != nil {
    			return err
    		}
    		shieldDc, err := edgecenter.GetCdnShieldingLocation(ctx, &edgecenter.GetCdnShieldingLocationArgs{
    			Datacenter: "dt",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = edgecenter.NewCdnShielding(ctx, "shielding", &edgecenter.CdnShieldingArgs{
    			ResourceId:   cdnRes1.CdnResourceId,
    			ShieldingPop: pulumi.String(shieldDc.Id),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Edgecenter = Pulumi.Edgecenter;
    
    return await Deployment.RunAsync(() => 
    {
        var sourceGroup1 = new Edgecenter.CdnOrigingroup("sourceGroup1", new()
        {
            UseNext = true,
            Origins = new[]
            {
                new Edgecenter.Inputs.CdnOrigingroupOriginArgs
                {
                    Source = "example.com",
                    Enabled = true,
                },
            },
        });
    
        var cdnRes1 = new Edgecenter.CdnResource("cdnRes1", new()
        {
            Cname = "cdn.example.com",
            OriginGroup = sourceGroup1.CdnOrigingroupId,
        });
    
        var shieldDc = Edgecenter.GetCdnShieldingLocation.Invoke(new()
        {
            Datacenter = "dt",
        });
    
        var shielding = new Edgecenter.CdnShielding("shielding", new()
        {
            ResourceId = cdnRes1.CdnResourceId,
            ShieldingPop = shieldDc.Apply(getCdnShieldingLocationResult => getCdnShieldingLocationResult.Id),
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.edgecenter.CdnOrigingroup;
    import com.pulumi.edgecenter.CdnOrigingroupArgs;
    import com.pulumi.edgecenter.inputs.CdnOrigingroupOriginArgs;
    import com.pulumi.edgecenter.CdnResource;
    import com.pulumi.edgecenter.CdnResourceArgs;
    import com.pulumi.edgecenter.EdgecenterFunctions;
    import com.pulumi.edgecenter.inputs.GetCdnShieldingLocationArgs;
    import com.pulumi.edgecenter.CdnShielding;
    import com.pulumi.edgecenter.CdnShieldingArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var sourceGroup1 = new CdnOrigingroup("sourceGroup1", CdnOrigingroupArgs.builder()
                .useNext(true)
                .origins(CdnOrigingroupOriginArgs.builder()
                    .source("example.com")
                    .enabled(true)
                    .build())
                .build());
    
            var cdnRes1 = new CdnResource("cdnRes1", CdnResourceArgs.builder()
                .cname("cdn.example.com")
                .originGroup(sourceGroup1.cdnOrigingroupId())
                .build());
    
            final var shieldDc = EdgecenterFunctions.getCdnShieldingLocation(GetCdnShieldingLocationArgs.builder()
                .datacenter("dt")
                .build());
    
            var shielding = new CdnShielding("shielding", CdnShieldingArgs.builder()
                .resourceId(cdnRes1.cdnResourceId())
                .shieldingPop(shieldDc.applyValue(getCdnShieldingLocationResult -> getCdnShieldingLocationResult.id()))
                .build());
    
        }
    }
    
    resources:
      sourceGroup1:
        type: edgecenter:CdnOrigingroup
        properties:
          useNext: true
          origins:
            - source: example.com
              enabled: true
      cdnRes1:
        type: edgecenter:CdnResource
        properties:
          cname: cdn.example.com
          originGroup: ${sourceGroup1.cdnOrigingroupId}
      shielding:
        type: edgecenter:CdnShielding
        properties:
          resourceId: ${cdnRes1.cdnResourceId}
          shieldingPop: ${shieldDc.id}
    variables:
      shieldDc:
        fn::invoke:
          function: edgecenter:getCdnShieldingLocation
          arguments:
            datacenter: dt
    

    Create CdnShielding Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new CdnShielding(name: string, args: CdnShieldingArgs, opts?: CustomResourceOptions);
    @overload
    def CdnShielding(resource_name: str,
                     args: CdnShieldingArgs,
                     opts: Optional[ResourceOptions] = None)
    
    @overload
    def CdnShielding(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     resource_id: Optional[float] = None,
                     shielding_pop: Optional[float] = None,
                     cdn_shielding_id: Optional[str] = None)
    func NewCdnShielding(ctx *Context, name string, args CdnShieldingArgs, opts ...ResourceOption) (*CdnShielding, error)
    public CdnShielding(string name, CdnShieldingArgs args, CustomResourceOptions? opts = null)
    public CdnShielding(String name, CdnShieldingArgs args)
    public CdnShielding(String name, CdnShieldingArgs args, CustomResourceOptions options)
    
    type: edgecenter:CdnShielding
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args CdnShieldingArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args CdnShieldingArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args CdnShieldingArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args CdnShieldingArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args CdnShieldingArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var cdnShieldingResource = new Edgecenter.CdnShielding("cdnShieldingResource", new()
    {
        ResourceId = 0,
        ShieldingPop = 0,
        CdnShieldingId = "string",
    });
    
    example, err := edgecenter.NewCdnShielding(ctx, "cdnShieldingResource", &edgecenter.CdnShieldingArgs{
    	ResourceId:     pulumi.Float64(0),
    	ShieldingPop:   pulumi.Float64(0),
    	CdnShieldingId: pulumi.String("string"),
    })
    
    var cdnShieldingResource = new CdnShielding("cdnShieldingResource", CdnShieldingArgs.builder()
        .resourceId(0)
        .shieldingPop(0)
        .cdnShieldingId("string")
        .build());
    
    cdn_shielding_resource = edgecenter.CdnShielding("cdnShieldingResource",
        resource_id=0,
        shielding_pop=0,
        cdn_shielding_id="string")
    
    const cdnShieldingResource = new edgecenter.CdnShielding("cdnShieldingResource", {
        resourceId: 0,
        shieldingPop: 0,
        cdnShieldingId: "string",
    });
    
    type: edgecenter:CdnShielding
    properties:
        cdnShieldingId: string
        resourceId: 0
        shieldingPop: 0
    

    CdnShielding Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The CdnShielding resource accepts the following input properties:

    ResourceId double
    Enter the CDN resource ID to which the Origin shielding should be applied.
    ShieldingPop double
    Set the origin shielding location ID or disable the option using the null value.
    CdnShieldingId string
    The ID of this resource.
    ResourceId float64
    Enter the CDN resource ID to which the Origin shielding should be applied.
    ShieldingPop float64
    Set the origin shielding location ID or disable the option using the null value.
    CdnShieldingId string
    The ID of this resource.
    resourceId Double
    Enter the CDN resource ID to which the Origin shielding should be applied.
    shieldingPop Double
    Set the origin shielding location ID or disable the option using the null value.
    cdnShieldingId String
    The ID of this resource.
    resourceId number
    Enter the CDN resource ID to which the Origin shielding should be applied.
    shieldingPop number
    Set the origin shielding location ID or disable the option using the null value.
    cdnShieldingId string
    The ID of this resource.
    resource_id float
    Enter the CDN resource ID to which the Origin shielding should be applied.
    shielding_pop float
    Set the origin shielding location ID or disable the option using the null value.
    cdn_shielding_id str
    The ID of this resource.
    resourceId Number
    Enter the CDN resource ID to which the Origin shielding should be applied.
    shieldingPop Number
    Set the origin shielding location ID or disable the option using the null value.
    cdnShieldingId String
    The ID of this resource.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the CdnShielding resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing CdnShielding Resource

    Get an existing CdnShielding resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: CdnShieldingState, opts?: CustomResourceOptions): CdnShielding
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            cdn_shielding_id: Optional[str] = None,
            resource_id: Optional[float] = None,
            shielding_pop: Optional[float] = None) -> CdnShielding
    func GetCdnShielding(ctx *Context, name string, id IDInput, state *CdnShieldingState, opts ...ResourceOption) (*CdnShielding, error)
    public static CdnShielding Get(string name, Input<string> id, CdnShieldingState? state, CustomResourceOptions? opts = null)
    public static CdnShielding get(String name, Output<String> id, CdnShieldingState state, CustomResourceOptions options)
    resources:  _:    type: edgecenter:CdnShielding    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    CdnShieldingId string
    The ID of this resource.
    ResourceId double
    Enter the CDN resource ID to which the Origin shielding should be applied.
    ShieldingPop double
    Set the origin shielding location ID or disable the option using the null value.
    CdnShieldingId string
    The ID of this resource.
    ResourceId float64
    Enter the CDN resource ID to which the Origin shielding should be applied.
    ShieldingPop float64
    Set the origin shielding location ID or disable the option using the null value.
    cdnShieldingId String
    The ID of this resource.
    resourceId Double
    Enter the CDN resource ID to which the Origin shielding should be applied.
    shieldingPop Double
    Set the origin shielding location ID or disable the option using the null value.
    cdnShieldingId string
    The ID of this resource.
    resourceId number
    Enter the CDN resource ID to which the Origin shielding should be applied.
    shieldingPop number
    Set the origin shielding location ID or disable the option using the null value.
    cdn_shielding_id str
    The ID of this resource.
    resource_id float
    Enter the CDN resource ID to which the Origin shielding should be applied.
    shielding_pop float
    Set the origin shielding location ID or disable the option using the null value.
    cdnShieldingId String
    The ID of this resource.
    resourceId Number
    Enter the CDN resource ID to which the Origin shielding should be applied.
    shieldingPop Number
    Set the origin shielding location ID or disable the option using the null value.

    Package Details

    Repository
    edgecenter edge-center/terraform-provider-edgecenter
    License
    Notes
    This Pulumi package is based on the edgecenter Terraform Provider.
    edgecenter logo
    edgecenter 0.8.0 published on Wednesday, Apr 30, 2025 by edge-center