@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
113 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 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, { ...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["compatibility"] = state?.compatibility;
resourceInputs["dataFormat"] = state?.dataFormat;
resourceInputs["description"] = state?.description;
resourceInputs["latestSchemaVersion"] = state?.latestSchemaVersion;
resourceInputs["nextSchemaVersion"] = state?.nextSchemaVersion;
resourceInputs["region"] = state?.region;
resourceInputs["registryArn"] = state?.registryArn;
resourceInputs["registryName"] = state?.registryName;
resourceInputs["schemaCheckpoint"] = state?.schemaCheckpoint;
resourceInputs["schemaDefinition"] = state?.schemaDefinition;
resourceInputs["schemaName"] = state?.schemaName;
resourceInputs["tags"] = state?.tags;
resourceInputs["tagsAll"] = state?.tagsAll;
}
else {
const args = argsOrState;
if (args?.compatibility === undefined && !opts.urn) {
throw new Error("Missing required property 'compatibility'");
}
if (args?.dataFormat === undefined && !opts.urn) {
throw new Error("Missing required property 'dataFormat'");
}
if (args?.schemaDefinition === undefined && !opts.urn) {
throw new Error("Missing required property 'schemaDefinition'");
}
if (args?.schemaName === undefined && !opts.urn) {
throw new Error("Missing required property 'schemaName'");
}
resourceInputs["compatibility"] = args?.compatibility;
resourceInputs["dataFormat"] = args?.dataFormat;
resourceInputs["description"] = args?.description;
resourceInputs["region"] = args?.region;
resourceInputs["registryArn"] = args?.registryArn;
resourceInputs["schemaDefinition"] = args?.schemaDefinition;
resourceInputs["schemaName"] = args?.schemaName;
resourceInputs["tags"] = args?.tags;
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
;