@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
113 lines • 5.45 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 a Glue Schema resource.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.glue.Schema("example", {
* schemaName: "example",
* registryArn: test.arn,
* dataFormat: "AVRO",
* compatibility: "NONE",
* schemaDefinition: "{\"type\": \"record\", \"name\": \"r1\", \"fields\": [ {\"name\": \"f1\", \"type\": \"int\"}, {\"name\": \"f2\", \"type\": \"string\"} ]}",
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import Glue Registries using `arn`. For example:
*
* ```sh
* $ pulumi import aws:glue/schema:Schema example arn:aws:glue:us-west-2:123456789012:schema/example/example
* ```
*/
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, Object.assign(Object.assign({}, 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 ? state.arn : undefined;
resourceInputs["compatibility"] = state ? state.compatibility : undefined;
resourceInputs["dataFormat"] = state ? state.dataFormat : undefined;
resourceInputs["description"] = state ? state.description : undefined;
resourceInputs["latestSchemaVersion"] = state ? state.latestSchemaVersion : undefined;
resourceInputs["nextSchemaVersion"] = state ? state.nextSchemaVersion : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["registryArn"] = state ? state.registryArn : undefined;
resourceInputs["registryName"] = state ? state.registryName : undefined;
resourceInputs["schemaCheckpoint"] = state ? state.schemaCheckpoint : undefined;
resourceInputs["schemaDefinition"] = state ? state.schemaDefinition : undefined;
resourceInputs["schemaName"] = state ? state.schemaName : undefined;
resourceInputs["tags"] = state ? state.tags : undefined;
resourceInputs["tagsAll"] = state ? state.tagsAll : undefined;
}
else {
const args = argsOrState;
if ((!args || args.compatibility === undefined) && !opts.urn) {
throw new Error("Missing required property 'compatibility'");
}
if ((!args || args.dataFormat === undefined) && !opts.urn) {
throw new Error("Missing required property 'dataFormat'");
}
if ((!args || args.schemaDefinition === undefined) && !opts.urn) {
throw new Error("Missing required property 'schemaDefinition'");
}
if ((!args || args.schemaName === undefined) && !opts.urn) {
throw new Error("Missing required property 'schemaName'");
}
resourceInputs["compatibility"] = args ? args.compatibility : undefined;
resourceInputs["dataFormat"] = args ? args.dataFormat : undefined;
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["registryArn"] = args ? args.registryArn : undefined;
resourceInputs["schemaDefinition"] = args ? args.schemaDefinition : undefined;
resourceInputs["schemaName"] = args ? args.schemaName : undefined;
resourceInputs["tags"] = args ? args.tags : undefined;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["latestSchemaVersion"] = undefined /*out*/;
resourceInputs["nextSchemaVersion"] = undefined /*out*/;
resourceInputs["registryName"] = undefined /*out*/;
resourceInputs["schemaCheckpoint"] = undefined /*out*/;
resourceInputs["tagsAll"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Schema.__pulumiType, name, resourceInputs, opts);
}
}
exports.Schema = Schema;
/** @internal */
Schema.__pulumiType = 'aws:glue/schema:Schema';
//# sourceMappingURL=schema.js.map