1. Packages
  2. Gcore Provider
  3. API Docs
  4. getCdnShieldingLocation
gcore 0.22.0 published on Wednesday, Apr 30, 2025 by g-core

gcore.getCdnShieldingLocation

Explore with Pulumi AI

gcore logo
gcore 0.22.0 published on Wednesday, Apr 30, 2025 by g-core

    Represent shielding locations data

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as gcore from "@pulumi/gcore";
    
    const sl = gcore.getCdnShieldingLocation({
        datacenter: "am3",
    });
    const originShielding1 = new gcore.CdnOriginshielding("originShielding1", {
        resourceId: 1,
        shieldingPop: sl.then(sl => sl.id),
    });
    
    import pulumi
    import pulumi_gcore as gcore
    
    sl = gcore.get_cdn_shielding_location(datacenter="am3")
    origin_shielding1 = gcore.CdnOriginshielding("originShielding1",
        resource_id=1,
        shielding_pop=sl.id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/gcore/gcore"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		sl, err := gcore.GetCdnShieldingLocation(ctx, &gcore.GetCdnShieldingLocationArgs{
    			Datacenter: "am3",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = gcore.NewCdnOriginshielding(ctx, "originShielding1", &gcore.CdnOriginshieldingArgs{
    			ResourceId:   pulumi.Float64(1),
    			ShieldingPop: pulumi.String(sl.Id),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcore = Pulumi.Gcore;
    
    return await Deployment.RunAsync(() => 
    {
        var sl = Gcore.GetCdnShieldingLocation.Invoke(new()
        {
            Datacenter = "am3",
        });
    
        var originShielding1 = new Gcore.CdnOriginshielding("originShielding1", new()
        {
            ResourceId = 1,
            ShieldingPop = sl.Apply(getCdnShieldingLocationResult => getCdnShieldingLocationResult.Id),
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcore.GcoreFunctions;
    import com.pulumi.gcore.inputs.GetCdnShieldingLocationArgs;
    import com.pulumi.gcore.CdnOriginshielding;
    import com.pulumi.gcore.CdnOriginshieldingArgs;
    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) {
            final var sl = GcoreFunctions.getCdnShieldingLocation(GetCdnShieldingLocationArgs.builder()
                .datacenter("am3")
                .build());
    
            var originShielding1 = new CdnOriginshielding("originShielding1", CdnOriginshieldingArgs.builder()
                .resourceId(1)
                .shieldingPop(sl.applyValue(getCdnShieldingLocationResult -> getCdnShieldingLocationResult.id()))
                .build());
    
        }
    }
    
    resources:
      originShielding1:
        type: gcore:CdnOriginshielding
        properties:
          resourceId: 1
          shieldingPop: ${sl.id}
    variables:
      sl:
        fn::invoke:
          function: gcore:getCdnShieldingLocation
          arguments:
            datacenter: am3
    

    Using getCdnShieldingLocation

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getCdnShieldingLocation(args: GetCdnShieldingLocationArgs, opts?: InvokeOptions): Promise<GetCdnShieldingLocationResult>
    function getCdnShieldingLocationOutput(args: GetCdnShieldingLocationOutputArgs, opts?: InvokeOptions): Output<GetCdnShieldingLocationResult>
    def get_cdn_shielding_location(datacenter: Optional[str] = None,
                                   id: Optional[str] = None,
                                   opts: Optional[InvokeOptions] = None) -> GetCdnShieldingLocationResult
    def get_cdn_shielding_location_output(datacenter: Optional[pulumi.Input[str]] = None,
                                   id: Optional[pulumi.Input[str]] = None,
                                   opts: Optional[InvokeOptions] = None) -> Output[GetCdnShieldingLocationResult]
    func GetCdnShieldingLocation(ctx *Context, args *GetCdnShieldingLocationArgs, opts ...InvokeOption) (*GetCdnShieldingLocationResult, error)
    func GetCdnShieldingLocationOutput(ctx *Context, args *GetCdnShieldingLocationOutputArgs, opts ...InvokeOption) GetCdnShieldingLocationResultOutput

    > Note: This function is named GetCdnShieldingLocation in the Go SDK.

    public static class GetCdnShieldingLocation 
    {
        public static Task<GetCdnShieldingLocationResult> InvokeAsync(GetCdnShieldingLocationArgs args, InvokeOptions? opts = null)
        public static Output<GetCdnShieldingLocationResult> Invoke(GetCdnShieldingLocationInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetCdnShieldingLocationResult> getCdnShieldingLocation(GetCdnShieldingLocationArgs args, InvokeOptions options)
    public static Output<GetCdnShieldingLocationResult> getCdnShieldingLocation(GetCdnShieldingLocationArgs args, InvokeOptions options)
    
    fn::invoke:
      function: gcore:index/getCdnShieldingLocation:getCdnShieldingLocation
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Datacenter string
    Displayed shielding location for point of present
    Id string
    The ID of this resource.
    Datacenter string
    Displayed shielding location for point of present
    Id string
    The ID of this resource.
    datacenter String
    Displayed shielding location for point of present
    id String
    The ID of this resource.
    datacenter string
    Displayed shielding location for point of present
    id string
    The ID of this resource.
    datacenter str
    Displayed shielding location for point of present
    id str
    The ID of this resource.
    datacenter String
    Displayed shielding location for point of present
    id String
    The ID of this resource.

    getCdnShieldingLocation Result

    The following output properties are available:

    Datacenter string
    Displayed shielding location for point of present
    Id string
    The ID of this resource.
    Datacenter string
    Displayed shielding location for point of present
    Id string
    The ID of this resource.
    datacenter String
    Displayed shielding location for point of present
    id String
    The ID of this resource.
    datacenter string
    Displayed shielding location for point of present
    id string
    The ID of this resource.
    datacenter str
    Displayed shielding location for point of present
    id str
    The ID of this resource.
    datacenter String
    Displayed shielding location for point of present
    id String
    The ID of this resource.

    Package Details

    Repository
    gcore g-core/terraform-provider-gcore
    License
    Notes
    This Pulumi package is based on the gcore Terraform Provider.
    gcore logo
    gcore 0.22.0 published on Wednesday, Apr 30, 2025 by g-core