@pulumiverse/time
Version:
A Pulumi package for creating and managing Time resources
107 lines • 4.09 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.Static = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* ## Example Usage
*
* ### Basic Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as time from "@pulumiverse/time";
*
* const example = new time.Static("example", {});
* export const currentTime = example.rfc3339;
* ```
*
* ### Triggers Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
* import * as time from "@pulumiverse/time";
*
* const amiUpdate = new time.Static("amiUpdate", {triggers: {
* ami_id: data.aws_ami.example.id,
* }});
* const server = new aws.ec2.Instance("server", {
* ami: amiUpdate.triggers.apply(triggers => triggers?.amiId),
* tags: {
* AmiUpdateTime: amiUpdate.rfc3339,
* },
* });
* // ... (other aws_instance arguments) ...
* ```
*
* ## Import
*
* This resource can be imported using the UTC RFC3339 value, e.g.
*
* ```sh
* $ pulumi import time:index/static:Static example 2020-02-12T06:36:13Z
* ```
*
* The `triggers` argument cannot be imported.
*/
class Static extends pulumi.CustomResource {
/**
* Get an existing Static 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 Static(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of Static. 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'] === Static.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["day"] = state ? state.day : undefined;
resourceInputs["hour"] = state ? state.hour : undefined;
resourceInputs["minute"] = state ? state.minute : undefined;
resourceInputs["month"] = state ? state.month : undefined;
resourceInputs["rfc3339"] = state ? state.rfc3339 : undefined;
resourceInputs["second"] = state ? state.second : undefined;
resourceInputs["triggers"] = state ? state.triggers : undefined;
resourceInputs["unix"] = state ? state.unix : undefined;
resourceInputs["year"] = state ? state.year : undefined;
}
else {
const args = argsOrState;
resourceInputs["rfc3339"] = args ? args.rfc3339 : undefined;
resourceInputs["triggers"] = args ? args.triggers : undefined;
resourceInputs["day"] = undefined /*out*/;
resourceInputs["hour"] = undefined /*out*/;
resourceInputs["minute"] = undefined /*out*/;
resourceInputs["month"] = undefined /*out*/;
resourceInputs["second"] = undefined /*out*/;
resourceInputs["unix"] = undefined /*out*/;
resourceInputs["year"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Static.__pulumiType, name, resourceInputs, opts);
}
}
exports.Static = Static;
/** @internal */
Static.__pulumiType = 'time:index/static:Static';
//# sourceMappingURL=static.js.map