@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
128 lines • 4.97 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.Schema = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides an EventBridge Schema resource.
*
* > **Note:** EventBridge was formerly known as CloudWatch Events. The functionality is identical.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const test = new aws.schemas.Registry("test", {name: "my_own_registry"});
* const testSchema = new aws.schemas.Schema("test", {
* name: "my_schema",
* registryName: test.name,
* type: "OpenApi3",
* description: "The schema definition for my event",
* content: JSON.stringify({
* openapi: "3.0.0",
* info: {
* version: "1.0.0",
* title: "Event",
* },
* paths: {},
* components: {
* schemas: {
* Event: {
* type: "object",
* properties: {
* name: {
* type: "string",
* },
* },
* },
* },
* },
* }),
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import EventBridge schema using the `name` and `registry_name`. For example:
*
* ```sh
* $ pulumi import aws:schemas/schema:Schema test name/registry
* ```
*/
class Schema extends pulumi.CustomResource {
/**
* Get an existing Schema 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 Schema(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of Schema. 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'] === Schema.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["arn"] = state?.arn;
resourceInputs["content"] = state?.content;
resourceInputs["description"] = state?.description;
resourceInputs["lastModified"] = state?.lastModified;
resourceInputs["name"] = state?.name;
resourceInputs["region"] = state?.region;
resourceInputs["registryName"] = state?.registryName;
resourceInputs["tags"] = state?.tags;
resourceInputs["tagsAll"] = state?.tagsAll;
resourceInputs["type"] = state?.type;
resourceInputs["version"] = state?.version;
resourceInputs["versionCreatedDate"] = state?.versionCreatedDate;
}
else {
const args = argsOrState;
if (args?.content === undefined && !opts.urn) {
throw new Error("Missing required property 'content'");
}
if (args?.registryName === undefined && !opts.urn) {
throw new Error("Missing required property 'registryName'");
}
if (args?.type === undefined && !opts.urn) {
throw new Error("Missing required property 'type'");
}
resourceInputs["content"] = args?.content;
resourceInputs["description"] = args?.description;
resourceInputs["name"] = args?.name;
resourceInputs["region"] = args?.region;
resourceInputs["registryName"] = args?.registryName;
resourceInputs["tags"] = args?.tags;
resourceInputs["type"] = args?.type;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["lastModified"] = undefined /*out*/;
resourceInputs["tagsAll"] = undefined /*out*/;
resourceInputs["version"] = undefined /*out*/;
resourceInputs["versionCreatedDate"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Schema.__pulumiType, name, resourceInputs, opts);
}
}
exports.Schema = Schema;
/** @internal */
Schema.__pulumiType = 'aws:schemas/schema:Schema';
//# sourceMappingURL=schema.js.map
;