UNPKG

@pulumiverse/time

Version:

A Pulumi package for creating and managing Time resources

137 lines 5.72 kB
"use strict"; // *** 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.Offset = 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.Offset("example", {offsetDays: 7}); * export const oneWeekFromNow = example.rfc3339; * ``` * * ### Multiple Offsets Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as time from "@pulumiverse/time"; * * const example = new time.Offset("example", { * offsetYears: 1, * offsetMonths: 1, * }); * export const oneYearAndMonthFromNow = 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.Offset("amiUpdate", { * triggers: { * ami_id: data.aws_ami.example.id, * }, * offsetDays: 7, * }); * const server = new aws.ec2.Instance("server", { * ami: amiUpdate.triggers.apply(triggers => triggers?.amiId), * tags: { * ExpirationTime: amiUpdate.rfc3339, * }, * }); * // ... (other aws_instance arguments) ... * ``` * * ## Import * * This resource can be imported using the base UTC RFC3339 timestamp and offset years, months, days, hours, minutes, and seconds, separated by commas (`,`), e.g. * * ```sh * $ pulumi import time:index/offset:Offset example 2020-02-12T06:36:13Z,0,0,7,0,0,0 * ``` * * The `triggers` argument cannot be imported. */ class Offset extends pulumi.CustomResource { /** * Get an existing Offset 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 Offset(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of Offset. 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'] === Offset.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["baseRfc3339"] = state ? state.baseRfc3339 : undefined; 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["offsetDays"] = state ? state.offsetDays : undefined; resourceInputs["offsetHours"] = state ? state.offsetHours : undefined; resourceInputs["offsetMinutes"] = state ? state.offsetMinutes : undefined; resourceInputs["offsetMonths"] = state ? state.offsetMonths : undefined; resourceInputs["offsetSeconds"] = state ? state.offsetSeconds : undefined; resourceInputs["offsetYears"] = state ? state.offsetYears : 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["baseRfc3339"] = args ? args.baseRfc3339 : undefined; resourceInputs["offsetDays"] = args ? args.offsetDays : undefined; resourceInputs["offsetHours"] = args ? args.offsetHours : undefined; resourceInputs["offsetMinutes"] = args ? args.offsetMinutes : undefined; resourceInputs["offsetMonths"] = args ? args.offsetMonths : undefined; resourceInputs["offsetSeconds"] = args ? args.offsetSeconds : undefined; resourceInputs["offsetYears"] = args ? args.offsetYears : undefined; resourceInputs["triggers"] = args ? args.triggers : undefined; resourceInputs["day"] = undefined /*out*/; resourceInputs["hour"] = undefined /*out*/; resourceInputs["minute"] = undefined /*out*/; resourceInputs["month"] = undefined /*out*/; resourceInputs["rfc3339"] = undefined /*out*/; resourceInputs["second"] = undefined /*out*/; resourceInputs["unix"] = undefined /*out*/; resourceInputs["year"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Offset.__pulumiType, name, resourceInputs, opts); } } exports.Offset = Offset; /** @internal */ Offset.__pulumiType = 'time:index/offset:Offset'; //# sourceMappingURL=offset.js.map