1. Packages
  2. Yandex
  3. API Docs
  4. CdnOriginGroup
Yandex v0.13.0 published on Tuesday, Feb 22, 2022 by Pulumi

yandex.CdnOriginGroup

Explore with Pulumi AI

yandex logo
Yandex v0.13.0 published on Tuesday, Feb 22, 2022 by Pulumi

    Allows management of Yandex.Cloud CDN Origin Groups.

    NOTE: CDN provider must be activated prior usage of CDN resources, either via UI console or via yc cli command: yc cdn provider activate --folder-id <folder-id> --type gcore

    Example Usage

    using Pulumi;
    using Yandex = Pulumi.Yandex;
    
    class MyStack : Stack
    {
        public MyStack()
        {
            var myGroup = new Yandex.CdnOriginGroup("myGroup", new Yandex.CdnOriginGroupArgs
            {
                Origins = 
                {
                    new Yandex.Inputs.CdnOriginGroupOriginArgs
                    {
                        Source = "ya.ru",
                    },
                    new Yandex.Inputs.CdnOriginGroupOriginArgs
                    {
                        Source = "yandex.ru",
                    },
                    new Yandex.Inputs.CdnOriginGroupOriginArgs
                    {
                        Source = "goo.gl",
                    },
                    new Yandex.Inputs.CdnOriginGroupOriginArgs
                    {
                        Backup = false,
                        Source = "amazon.com",
                    },
                },
                UseNext = true,
            });
        }
    
    }
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-yandex/sdk/go/yandex"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := yandex.NewCdnOriginGroup(ctx, "myGroup", &yandex.CdnOriginGroupArgs{
    			Origins: CdnOriginGroupOriginArray{
    				&CdnOriginGroupOriginArgs{
    					Source: pulumi.String("ya.ru"),
    				},
    				&CdnOriginGroupOriginArgs{
    					Source: pulumi.String("yandex.ru"),
    				},
    				&CdnOriginGroupOriginArgs{
    					Source: pulumi.String("goo.gl"),
    				},
    				&CdnOriginGroupOriginArgs{
    					Backup: pulumi.Bool(false),
    					Source: pulumi.String("amazon.com"),
    				},
    			},
    			UseNext: pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    

    Coming soon!

    import pulumi
    import pulumi_yandex as yandex
    
    my_group = yandex.CdnOriginGroup("myGroup",
        origins=[
            yandex.CdnOriginGroupOriginArgs(
                source="ya.ru",
            ),
            yandex.CdnOriginGroupOriginArgs(
                source="yandex.ru",
            ),
            yandex.CdnOriginGroupOriginArgs(
                source="goo.gl",
            ),
            yandex.CdnOriginGroupOriginArgs(
                backup=False,
                source="amazon.com",
            ),
        ],
        use_next=True)
    
    import * as pulumi from "@pulumi/pulumi";
    import * as yandex from "@pulumi/yandex";
    
    const myGroup = new yandex.CdnOriginGroup("my_group", {
        origins: [
            {
                source: "ya.ru",
            },
            {
                source: "yandex.ru",
            },
            {
                source: "goo.gl",
            },
            {
                backup: false,
                source: "amazon.com",
            },
        ],
        useNext: true,
    });
    

    Coming soon!

    Create CdnOriginGroup Resource

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

    Constructor syntax

    new CdnOriginGroup(name: string, args: CdnOriginGroupArgs, opts?: CustomResourceOptions);
    @overload
    def CdnOriginGroup(resource_name: str,
                       args: CdnOriginGroupArgs,
                       opts: Optional[ResourceOptions] = None)
    
    @overload
    def CdnOriginGroup(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       origins: Optional[Sequence[CdnOriginGroupOriginArgs]] = None,
                       name: Optional[str] = None,
                       use_next: Optional[bool] = None)
    func NewCdnOriginGroup(ctx *Context, name string, args CdnOriginGroupArgs, opts ...ResourceOption) (*CdnOriginGroup, error)
    public CdnOriginGroup(string name, CdnOriginGroupArgs args, CustomResourceOptions? opts = null)
    public CdnOriginGroup(String name, CdnOriginGroupArgs args)
    public CdnOriginGroup(String name, CdnOriginGroupArgs args, CustomResourceOptions options)
    
    type: yandex:CdnOriginGroup
    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 CdnOriginGroupArgs
    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 CdnOriginGroupArgs
    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 CdnOriginGroupArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args CdnOriginGroupArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args CdnOriginGroupArgs
    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 cdnOriginGroupResource = new Yandex.CdnOriginGroup("cdnOriginGroupResource", new()
    {
        Origins = new[]
        {
            new Yandex.Inputs.CdnOriginGroupOriginArgs
            {
                Source = "string",
                Backup = false,
                Enabled = false,
                OriginGroupId = 0,
            },
        },
        Name = "string",
        UseNext = false,
    });
    
    example, err := yandex.NewCdnOriginGroup(ctx, "cdnOriginGroupResource", &yandex.CdnOriginGroupArgs{
    	Origins: yandex.CdnOriginGroupOriginArray{
    		&yandex.CdnOriginGroupOriginArgs{
    			Source:        pulumi.String("string"),
    			Backup:        pulumi.Bool(false),
    			Enabled:       pulumi.Bool(false),
    			OriginGroupId: pulumi.Int(0),
    		},
    	},
    	Name:    pulumi.String("string"),
    	UseNext: pulumi.Bool(false),
    })
    
    var cdnOriginGroupResource = new CdnOriginGroup("cdnOriginGroupResource", CdnOriginGroupArgs.builder()
        .origins(CdnOriginGroupOriginArgs.builder()
            .source("string")
            .backup(false)
            .enabled(false)
            .originGroupId(0)
            .build())
        .name("string")
        .useNext(false)
        .build());
    
    cdn_origin_group_resource = yandex.CdnOriginGroup("cdnOriginGroupResource",
        origins=[{
            "source": "string",
            "backup": False,
            "enabled": False,
            "origin_group_id": 0,
        }],
        name="string",
        use_next=False)
    
    const cdnOriginGroupResource = new yandex.CdnOriginGroup("cdnOriginGroupResource", {
        origins: [{
            source: "string",
            backup: false,
            enabled: false,
            originGroupId: 0,
        }],
        name: "string",
        useNext: false,
    });
    
    type: yandex:CdnOriginGroup
    properties:
        name: string
        origins:
            - backup: false
              enabled: false
              originGroupId: 0
              source: string
        useNext: false
    

    CdnOriginGroup 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 CdnOriginGroup resource accepts the following input properties:

    Origins List<CdnOriginGroupOrigin>
    Name string
    CDN Origin Group name used to define device.
    UseNext bool
    If the option is active (has true value), in case the origin responds with 4XX or 5XX codes, use the next origin from the list.
    Origins []CdnOriginGroupOriginArgs
    Name string
    CDN Origin Group name used to define device.
    UseNext bool
    If the option is active (has true value), in case the origin responds with 4XX or 5XX codes, use the next origin from the list.
    origins List<CdnOriginGroupOrigin>
    name String
    CDN Origin Group name used to define device.
    useNext Boolean
    If the option is active (has true value), in case the origin responds with 4XX or 5XX codes, use the next origin from the list.
    origins CdnOriginGroupOrigin[]
    name string
    CDN Origin Group name used to define device.
    useNext boolean
    If the option is active (has true value), in case the origin responds with 4XX or 5XX codes, use the next origin from the list.
    origins Sequence[CdnOriginGroupOriginArgs]
    name str
    CDN Origin Group name used to define device.
    use_next bool
    If the option is active (has true value), in case the origin responds with 4XX or 5XX codes, use the next origin from the list.
    origins List<Property Map>
    name String
    CDN Origin Group name used to define device.
    useNext Boolean
    If the option is active (has true value), in case the origin responds with 4XX or 5XX codes, use the next origin from the list.

    Outputs

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

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

    Look up Existing CdnOriginGroup Resource

    Get an existing CdnOriginGroup 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?: CdnOriginGroupState, opts?: CustomResourceOptions): CdnOriginGroup
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            folder_id: Optional[str] = None,
            name: Optional[str] = None,
            origins: Optional[Sequence[CdnOriginGroupOriginArgs]] = None,
            use_next: Optional[bool] = None) -> CdnOriginGroup
    func GetCdnOriginGroup(ctx *Context, name string, id IDInput, state *CdnOriginGroupState, opts ...ResourceOption) (*CdnOriginGroup, error)
    public static CdnOriginGroup Get(string name, Input<string> id, CdnOriginGroupState? state, CustomResourceOptions? opts = null)
    public static CdnOriginGroup get(String name, Output<String> id, CdnOriginGroupState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    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:
    FolderId string
    Name string
    CDN Origin Group name used to define device.
    Origins List<CdnOriginGroupOrigin>
    UseNext bool
    If the option is active (has true value), in case the origin responds with 4XX or 5XX codes, use the next origin from the list.
    FolderId string
    Name string
    CDN Origin Group name used to define device.
    Origins []CdnOriginGroupOriginArgs
    UseNext bool
    If the option is active (has true value), in case the origin responds with 4XX or 5XX codes, use the next origin from the list.
    folderId String
    name String
    CDN Origin Group name used to define device.
    origins List<CdnOriginGroupOrigin>
    useNext Boolean
    If the option is active (has true value), in case the origin responds with 4XX or 5XX codes, use the next origin from the list.
    folderId string
    name string
    CDN Origin Group name used to define device.
    origins CdnOriginGroupOrigin[]
    useNext boolean
    If the option is active (has true value), in case the origin responds with 4XX or 5XX codes, use the next origin from the list.
    folder_id str
    name str
    CDN Origin Group name used to define device.
    origins Sequence[CdnOriginGroupOriginArgs]
    use_next bool
    If the option is active (has true value), in case the origin responds with 4XX or 5XX codes, use the next origin from the list.
    folderId String
    name String
    CDN Origin Group name used to define device.
    origins List<Property Map>
    useNext Boolean
    If the option is active (has true value), in case the origin responds with 4XX or 5XX codes, use the next origin from the list.

    Supporting Types

    CdnOriginGroupOrigin, CdnOriginGroupOriginArgs

    source String
    backup Boolean
    enabled Boolean
    originGroupId Integer
    source string
    backup boolean
    enabled boolean
    originGroupId number
    source String
    backup Boolean
    enabled Boolean
    originGroupId Number

    Import

    A origin group can be imported using any of these accepted formats

     $ pulumi import yandex:index/cdnOriginGroup:CdnOriginGroup default origin_group_id
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Yandex pulumi/pulumi-yandex
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the yandex Terraform Provider.
    yandex logo
    Yandex v0.13.0 published on Tuesday, Feb 22, 2022 by Pulumi