Package com.pulumi.aws.datasync
Class Agent
- java.lang.Object
-
- com.pulumi.resources.Resource
-
- com.pulumi.resources.CustomResource
-
- com.pulumi.aws.datasync.Agent
-
public class Agent extends com.pulumi.resources.CustomResourceManages 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
### Example Usage with VPC Endpointspackage generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.aws.datasync.Agent; import com.pulumi.aws.datasync.AgentArgs; import java.util.ArrayList; import java.util.Arrays; import java.util.Map; import java.io.File; import java.nio.file.Files; import java.nio.file.Paths; public class App { public static void main(String[] args) { Pulumi.run(App::stack); } public static void stack(Context ctx) { var example = new Agent("example", AgentArgs.builder() .ipAddress("1.2.3.4") .name("example") .build()); } }
## Import ### Identity Schema #### Required - `arn` (String) ARN of the DataSync agent. Using `pulumi import`, import `aws.datasync.Agent` using the DataSync Agent ARN. For example: ```sh $ pulumi import aws:datasync/agent:Agent example arn:aws:datasync:us-east-1:123456789012:agent/agent-12345678901234567 ```package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.aws.AwsFunctions; import com.pulumi.aws.inputs.GetRegionArgs; import com.pulumi.aws.ec2.VpcEndpoint; import com.pulumi.aws.ec2.VpcEndpointArgs; import com.pulumi.aws.ec2.Ec2Functions; import com.pulumi.aws.ec2.inputs.GetNetworkInterfaceArgs; import com.pulumi.aws.datasync.Agent; import com.pulumi.aws.datasync.AgentArgs; import java.util.ArrayList; import java.util.Arrays; import java.util.Map; import java.io.File; import java.nio.file.Files; import java.nio.file.Paths; public class App { public static void main(String[] args) { Pulumi.run(App::stack); } public static void stack(Context ctx) { final var current = AwsFunctions.getRegion(GetRegionArgs.builder() .build()); var exampleVpcEndpoint = new VpcEndpoint("exampleVpcEndpoint", VpcEndpointArgs.builder() .serviceName(String.format("com.amazonaws.%s.datasync", current.region())) .vpcId(exampleAwsVpc.id()) .securityGroupIds(exampleAwsSecurityGroup.id()) .subnetIds(exampleAwsSubnet.id()) .vpcEndpointType("Interface") .build()); final var example = Ec2Functions.getNetworkInterface(GetNetworkInterfaceArgs.builder() .id(exampleVpcEndpoint.networkInterfaceIds().applyValue(_networkInterfaceIds -> _networkInterfaceIds[0])) .build()); var exampleAgent = new Agent("exampleAgent", AgentArgs.builder() .ipAddress("1.2.3.4") .securityGroupArns(exampleAwsSecurityGroup.arn()) .subnetArns(exampleAwsSubnet.arn()) .vpcEndpointId(exampleVpcEndpoint.id()) .privateLinkEndpoint(example.applyValue(_example -> _example.privateIp())) .name("example") .build()); } }
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.pulumi.core.Output<java.lang.String>activationKey()com.pulumi.core.Output<java.lang.String>arn()static Agentget(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, AgentState state, com.pulumi.resources.CustomResourceOptions options)Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.com.pulumi.core.Output<java.lang.String>ipAddress()com.pulumi.core.Output<java.lang.String>name()com.pulumi.core.Output<java.lang.String>privateLinkEndpoint()com.pulumi.core.Output<java.lang.String>region()com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>>securityGroupArns()com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>>subnetArns()com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,java.lang.String>>>tags()com.pulumi.core.Output<java.util.Map<java.lang.String,java.lang.String>>tagsAll()com.pulumi.core.Output<java.util.Optional<java.lang.String>>vpcEndpointId()
-
-
-
Constructor Detail
-
Agent
public Agent(java.lang.String name)
- Parameters:
name- The _unique_ name of the resulting resource.
-
Agent
public Agent(java.lang.String name, @Nullable AgentArgs args)- Parameters:
name- The _unique_ name of the resulting resource.args- The arguments to use to populate this resource's properties.
-
Agent
public Agent(java.lang.String name, @Nullable AgentArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options)- Parameters:
name- The _unique_ name of the resulting resource.args- The arguments to use to populate this resource's properties.options- A bag of options that control this resource's behavior.
-
-
Method Detail
-
activationKey
public com.pulumi.core.Output<java.lang.String> activationKey()
- Returns:
- DataSync Agent activation key during resource creation. Conflicts with `ipAddress`. If an `ipAddress` is provided instead, the provider will retrieve the `activationKey` as part of the resource creation.
-
arn
public com.pulumi.core.Output<java.lang.String> arn()
- Returns:
- ARN of the DataSync Agent.
-
ipAddress
public com.pulumi.core.Output<java.lang.String> ipAddress()
- Returns:
- DataSync Agent IP address to retrieve activation key during resource creation. Conflicts with `activationKey`. DataSync Agent must be accessible on port 80 from where the provider is running.
-
name
public com.pulumi.core.Output<java.lang.String> name()
- Returns:
- Name of the DataSync Agent.
-
privateLinkEndpoint
public com.pulumi.core.Output<java.lang.String> privateLinkEndpoint()
- Returns:
- The IP address of the VPC endpoint the agent should connect to when retrieving an activation key during resource creation. Conflicts with `activationKey`.
-
region
public com.pulumi.core.Output<java.lang.String> region()
- Returns:
- Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.
-
securityGroupArns
public com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>> securityGroupArns()
- Returns:
- The ARNs of the security groups used to protect your data transfer task subnets.
-
subnetArns
public com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>> subnetArns()
- Returns:
- ARNs of the subnets in which DataSync will create elastic network interfaces for each data transfer task.
-
tags
public com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,java.lang.String>>> tags()
- Returns:
- Key-value pairs of resource tags to assign to the DataSync Agent. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
-
tagsAll
public com.pulumi.core.Output<java.util.Map<java.lang.String,java.lang.String>> tagsAll()
- Returns:
- A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
-
vpcEndpointId
public com.pulumi.core.Output<java.util.Optional<java.lang.String>> vpcEndpointId()
- Returns:
- ID of the VPC endpoint that the agent has access to.
-
get
public static Agent get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, @Nullable AgentState state, @Nullable com.pulumi.resources.CustomResourceOptions options)
Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.- Parameters:
name- The _unique_ name of the resulting resource.id- The _unique_ provider ID of the resource to lookup.state-options- Optional settings to control the behavior of the CustomResource.
-
-