@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
121 lines • 5.07 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.Agent = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages an AWS DataSync Agent deployed on premises.
*
* > **NOTE:** One of `activationKey` or `ipAddress` must be provided for resource creation (agent activation). Neither is required for resource import. If using `ipAddress`, this provider must be able to make an HTTP (port 80) GET request to the specified IP address from where it is running. The agent will turn off that HTTP server after activation.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.datasync.Agent("example", {
* ipAddress: "1.2.3.4",
* name: "example",
* });
* ```
*
* ### With VPC Endpoints
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const current = aws.getRegion({});
* const exampleVpcEndpoint = new aws.ec2.VpcEndpoint("example", {
* serviceName: current.then(current => `com.amazonaws.${current.region}.datasync`),
* vpcId: exampleAwsVpc.id,
* securityGroupIds: [exampleAwsSecurityGroup.id],
* subnetIds: [exampleAwsSubnet.id],
* vpcEndpointType: "Interface",
* });
* const example = aws.ec2.getNetworkInterfaceOutput({
* id: exampleVpcEndpoint.networkInterfaceIds[0],
* });
* const exampleAgent = new aws.datasync.Agent("example", {
* ipAddress: "1.2.3.4",
* securityGroupArns: [exampleAwsSecurityGroup.arn],
* subnetArns: [exampleAwsSubnet.arn],
* vpcEndpointId: exampleVpcEndpoint.id,
* privateLinkEndpoint: example.apply(example => example.privateIp),
* name: "example",
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import `aws_datasync_agent` using the DataSync Agent Amazon Resource Name (ARN). For example:
*
* ```sh
* $ pulumi import aws:datasync/agent:Agent example arn:aws:datasync:us-east-1:123456789012:agent/agent-12345678901234567
* ```
*/
class Agent extends pulumi.CustomResource {
/**
* Get an existing Agent 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 Agent(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of Agent. 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'] === Agent.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["activationKey"] = state?.activationKey;
resourceInputs["arn"] = state?.arn;
resourceInputs["ipAddress"] = state?.ipAddress;
resourceInputs["name"] = state?.name;
resourceInputs["privateLinkEndpoint"] = state?.privateLinkEndpoint;
resourceInputs["region"] = state?.region;
resourceInputs["securityGroupArns"] = state?.securityGroupArns;
resourceInputs["subnetArns"] = state?.subnetArns;
resourceInputs["tags"] = state?.tags;
resourceInputs["tagsAll"] = state?.tagsAll;
resourceInputs["vpcEndpointId"] = state?.vpcEndpointId;
}
else {
const args = argsOrState;
resourceInputs["activationKey"] = args?.activationKey;
resourceInputs["ipAddress"] = args?.ipAddress;
resourceInputs["name"] = args?.name;
resourceInputs["privateLinkEndpoint"] = args?.privateLinkEndpoint;
resourceInputs["region"] = args?.region;
resourceInputs["securityGroupArns"] = args?.securityGroupArns;
resourceInputs["subnetArns"] = args?.subnetArns;
resourceInputs["tags"] = args?.tags;
resourceInputs["vpcEndpointId"] = args?.vpcEndpointId;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["tagsAll"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Agent.__pulumiType, name, resourceInputs, opts);
}
}
exports.Agent = Agent;
/** @internal */
Agent.__pulumiType = 'aws:datasync/agent:Agent';
//# sourceMappingURL=agent.js.map
;