@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
96 lines • 4.17 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.DomainEntry = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages a Lightsail domain entry (DNS record). Use this resource to define how DNS queries for your domain are handled.
*
* > **NOTE on `id`:** In an effort to simplify imports, this resource `id` field has been updated to the standard resource id separator, a comma (`,`). For backward compatibility, the previous separator (underscore `_`) can still be used to read and import existing resources. When state is refreshed, the `id` will be updated to use the new standard separator. The previous separator will be deprecated in a future major release.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.lightsail.Domain("example", {domainName: "example.com"});
* const exampleDomainEntry = new aws.lightsail.DomainEntry("example", {
* domainName: example.domainName,
* name: "www",
* type: "A",
* target: "127.0.0.1",
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import Lightsail Domain Entry using the id attribute. For example:
*
* ```sh
* $ pulumi import aws:lightsail/domainEntry:DomainEntry example www,example.com,A,127.0.0.1
* ```
*/
class DomainEntry extends pulumi.CustomResource {
/**
* Get an existing DomainEntry 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 DomainEntry(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of DomainEntry. 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'] === DomainEntry.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["domainName"] = state?.domainName;
resourceInputs["isAlias"] = state?.isAlias;
resourceInputs["name"] = state?.name;
resourceInputs["region"] = state?.region;
resourceInputs["target"] = state?.target;
resourceInputs["type"] = state?.type;
}
else {
const args = argsOrState;
if (args?.domainName === undefined && !opts.urn) {
throw new Error("Missing required property 'domainName'");
}
if (args?.target === undefined && !opts.urn) {
throw new Error("Missing required property 'target'");
}
if (args?.type === undefined && !opts.urn) {
throw new Error("Missing required property 'type'");
}
resourceInputs["domainName"] = args?.domainName;
resourceInputs["isAlias"] = args?.isAlias;
resourceInputs["name"] = args?.name;
resourceInputs["region"] = args?.region;
resourceInputs["target"] = args?.target;
resourceInputs["type"] = args?.type;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(DomainEntry.__pulumiType, name, resourceInputs, opts);
}
}
exports.DomainEntry = DomainEntry;
/** @internal */
DomainEntry.__pulumiType = 'aws:lightsail/domainEntry:DomainEntry';
//# sourceMappingURL=domainEntry.js.map