@pulumi/yandex
Version:
A Pulumi package for creating and managing yandex cloud resources.
104 lines • 4.78 kB
JavaScript
;
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.CdnResource = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Allows management of [Yandex.Cloud CDN Resource](https://cloud.yandex.ru/docs/cdn/concepts/resource).
*
* > **_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
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as yandex from "@pulumi/yandex";
*
* const myResource = new yandex.CdnResource("myResource", {
* cname: "cdn1.yandex-example.ru",
* active: false,
* originProtocol: "https",
* secondaryHostnames: [
* "cdn-example-1.yandex.ru",
* "cdn-example-2.yandex.ru",
* ],
* originGroupId: yandex_cdn_origin_group.foo_cdn_group_by_id.id,
* options: {
* edgeCacheSettings: 345600,
* ignoreCookie: true,
* },
* });
* ```
*
* ## Import
*
* A origin group can be imported using any of these accepted formats
*
* ```sh
* $ pulumi import yandex:index/cdnResource:CdnResource default origin_group_id
* ```
*/
class CdnResource extends pulumi.CustomResource {
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["active"] = state ? state.active : undefined;
resourceInputs["cname"] = state ? state.cname : undefined;
resourceInputs["createdAt"] = state ? state.createdAt : undefined;
resourceInputs["folderId"] = state ? state.folderId : undefined;
resourceInputs["options"] = state ? state.options : undefined;
resourceInputs["originGroupId"] = state ? state.originGroupId : undefined;
resourceInputs["originGroupName"] = state ? state.originGroupName : undefined;
resourceInputs["originProtocol"] = state ? state.originProtocol : undefined;
resourceInputs["secondaryHostnames"] = state ? state.secondaryHostnames : undefined;
resourceInputs["sslCertificate"] = state ? state.sslCertificate : undefined;
resourceInputs["updatedAt"] = state ? state.updatedAt : undefined;
}
else {
const args = argsOrState;
resourceInputs["active"] = args ? args.active : undefined;
resourceInputs["cname"] = args ? args.cname : undefined;
resourceInputs["options"] = args ? args.options : undefined;
resourceInputs["originGroupId"] = args ? args.originGroupId : undefined;
resourceInputs["originGroupName"] = args ? args.originGroupName : undefined;
resourceInputs["originProtocol"] = args ? args.originProtocol : undefined;
resourceInputs["secondaryHostnames"] = args ? args.secondaryHostnames : undefined;
resourceInputs["sslCertificate"] = args ? args.sslCertificate : undefined;
resourceInputs["updatedAt"] = args ? args.updatedAt : undefined;
resourceInputs["createdAt"] = undefined /*out*/;
resourceInputs["folderId"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(CdnResource.__pulumiType, name, resourceInputs, opts);
}
/**
* Get an existing CdnResource resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name, id, state, opts) {
return new CdnResource(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of CdnResource. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === CdnResource.__pulumiType;
}
}
exports.CdnResource = CdnResource;
/** @internal */
CdnResource.__pulumiType = 'yandex:index/cdnResource:CdnResource';
//# sourceMappingURL=cdnResource.js.map