@upcloud/pulumi-upcloud
Version:
A Pulumi package for creating and managing UpCloud resources.
89 lines • 4.29 kB
JavaScript
;
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.ManagedObjectStorageCustomDomain = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* This resource represents an UpCloud Managed Object Storage custom domain. Note that DNS settings for the custom domain should be configured before creating this resource.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as upcloud from "@upcloud/pulumi-upcloud";
*
* const thisManagedObjectStorage = new upcloud.ManagedObjectStorage("this", {
* name: "object-storage-custom-domain-example",
* region: "europe-1",
* configuredStatus: "started",
* networks: [{
* family: "IPv4",
* name: "public",
* type: "public",
* }],
* });
* const _this = upcloud.getLoadBalancerDnsChallengeDomain({});
* // Before creating the custom domain, configure the DNS settings for your custom domain. For example, if your custom domain is objects.example.com, you should configure the following DNS records:
* // - "_acme-challenge.objects IN CNAME ${data.upcloud_load_balancer_dns_challenge_domain.this.domain}"
* // - "objects IN CNAME ${[for i in upcloud_managed_object_storage.this.endpoint: i.domain_name if i.type == "public"][0]}"
* // - "*.objects IN CNAME ${[for i in upcloud_managed_object_storage.this.endpoint: i.domain_name if i.type == "public"][0]}"
* const thisManagedObjectStorageCustomDomain = new upcloud.ManagedObjectStorageCustomDomain("this", {
* serviceUuid: thisManagedObjectStorage.id,
* domainName: "objects.example.com",
* });
* ```
*/
class ManagedObjectStorageCustomDomain extends pulumi.CustomResource {
/**
* Get an existing ManagedObjectStorageCustomDomain 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 ManagedObjectStorageCustomDomain(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of ManagedObjectStorageCustomDomain. 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'] === ManagedObjectStorageCustomDomain.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["domainName"] = state?.domainName;
resourceInputs["serviceUuid"] = state?.serviceUuid;
resourceInputs["type"] = state?.type;
}
else {
const args = argsOrState;
if (args?.domainName === undefined && !opts.urn) {
throw new Error("Missing required property 'domainName'");
}
if (args?.serviceUuid === undefined && !opts.urn) {
throw new Error("Missing required property 'serviceUuid'");
}
resourceInputs["domainName"] = args?.domainName;
resourceInputs["serviceUuid"] = args?.serviceUuid;
resourceInputs["type"] = args?.type;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(ManagedObjectStorageCustomDomain.__pulumiType, name, resourceInputs, opts);
}
}
exports.ManagedObjectStorageCustomDomain = ManagedObjectStorageCustomDomain;
/** @internal */
ManagedObjectStorageCustomDomain.__pulumiType = 'upcloud:index/managedObjectStorageCustomDomain:ManagedObjectStorageCustomDomain';
//# sourceMappingURL=managedObjectStorageCustomDomain.js.map