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

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,
        });
    }

}
Copy
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
	})
}
Copy

Coming soon!

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,
});
Copy
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)
Copy

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 This property is required. string
The unique name of the resource.
args This property is required. CdnOriginGroupArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. 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 This property is required. string
The unique name of the resource.
args This property is required. CdnOriginGroupArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. CdnOriginGroupArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. 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,
});
Copy
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),
})
Copy
var cdnOriginGroupResource = new CdnOriginGroup("cdnOriginGroupResource", CdnOriginGroupArgs.builder()
    .origins(CdnOriginGroupOriginArgs.builder()
        .source("string")
        .backup(false)
        .enabled(false)
        .originGroupId(0)
        .build())
    .name("string")
    .useNext(false)
    .build());
Copy
cdn_origin_group_resource = yandex.CdnOriginGroup("cdnOriginGroupResource",
    origins=[{
        "source": "string",
        "backup": False,
        "enabled": False,
        "origin_group_id": 0,
    }],
    name="string",
    use_next=False)
Copy
const cdnOriginGroupResource = new yandex.CdnOriginGroup("cdnOriginGroupResource", {
    origins: [{
        source: "string",
        backup: false,
        enabled: false,
        originGroupId: 0,
    }],
    name: "string",
    useNext: false,
});
Copy
type: yandex:CdnOriginGroup
properties:
    name: string
    origins:
        - backup: false
          enabled: false
          originGroupId: 0
          source: string
    useNext: false
Copy

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 This property is required. 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 This property is required. []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 This property is required. 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 This property is required. 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 This property is required. 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 This property is required. 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)
resources:  _:    type: yandex:CdnOriginGroup    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required. string
Backup bool
Enabled bool
OriginGroupId int
Source This property is required. string
Backup bool
Enabled bool
OriginGroupId int
source This property is required. String
backup Boolean
enabled Boolean
originGroupId Integer
source This property is required. string
backup boolean
enabled boolean
originGroupId number
source This property is required. str
backup bool
enabled bool
origin_group_id int
source This property is required. 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
Copy

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.