@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
122 lines • 5.3 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.PrimaryContact = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages the specified primary contact information associated with an AWS Account.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const test = new aws.account.PrimaryContact("test", {
* addressLine1: "123 Any Street",
* city: "Seattle",
* companyName: "Example Corp, Inc.",
* countryCode: "US",
* districtOrCounty: "King",
* fullName: "My Name",
* phoneNumber: "+64211111111",
* postalCode: "98101",
* stateOrRegion: "WA",
* websiteUrl: "https://www.examplecorp.com",
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import the Primary Contact using the `account_id`. For example:
*
* ```sh
* $ pulumi import aws:account/primaryContact:PrimaryContact test 1234567890
* ```
*/
class PrimaryContact extends pulumi.CustomResource {
/**
* Get an existing PrimaryContact 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 PrimaryContact(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of PrimaryContact. 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'] === PrimaryContact.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["accountId"] = state?.accountId;
resourceInputs["addressLine1"] = state?.addressLine1;
resourceInputs["addressLine2"] = state?.addressLine2;
resourceInputs["addressLine3"] = state?.addressLine3;
resourceInputs["city"] = state?.city;
resourceInputs["companyName"] = state?.companyName;
resourceInputs["countryCode"] = state?.countryCode;
resourceInputs["districtOrCounty"] = state?.districtOrCounty;
resourceInputs["fullName"] = state?.fullName;
resourceInputs["phoneNumber"] = state?.phoneNumber;
resourceInputs["postalCode"] = state?.postalCode;
resourceInputs["stateOrRegion"] = state?.stateOrRegion;
resourceInputs["websiteUrl"] = state?.websiteUrl;
}
else {
const args = argsOrState;
if (args?.addressLine1 === undefined && !opts.urn) {
throw new Error("Missing required property 'addressLine1'");
}
if (args?.city === undefined && !opts.urn) {
throw new Error("Missing required property 'city'");
}
if (args?.countryCode === undefined && !opts.urn) {
throw new Error("Missing required property 'countryCode'");
}
if (args?.fullName === undefined && !opts.urn) {
throw new Error("Missing required property 'fullName'");
}
if (args?.phoneNumber === undefined && !opts.urn) {
throw new Error("Missing required property 'phoneNumber'");
}
if (args?.postalCode === undefined && !opts.urn) {
throw new Error("Missing required property 'postalCode'");
}
resourceInputs["accountId"] = args?.accountId;
resourceInputs["addressLine1"] = args?.addressLine1;
resourceInputs["addressLine2"] = args?.addressLine2;
resourceInputs["addressLine3"] = args?.addressLine3;
resourceInputs["city"] = args?.city;
resourceInputs["companyName"] = args?.companyName;
resourceInputs["countryCode"] = args?.countryCode;
resourceInputs["districtOrCounty"] = args?.districtOrCounty;
resourceInputs["fullName"] = args?.fullName;
resourceInputs["phoneNumber"] = args?.phoneNumber;
resourceInputs["postalCode"] = args?.postalCode;
resourceInputs["stateOrRegion"] = args?.stateOrRegion;
resourceInputs["websiteUrl"] = args?.websiteUrl;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(PrimaryContact.__pulumiType, name, resourceInputs, opts);
}
}
exports.PrimaryContact = PrimaryContact;
/** @internal */
PrimaryContact.__pulumiType = 'aws:account/primaryContact:PrimaryContact';
//# sourceMappingURL=primaryContact.js.map