Class Instance


  • public class Instance
    extends com.pulumi.resources.CustomResource
    A Google Cloud Memcache instance. To get more information about Instance, see: * [API documentation](https://cloud.google.com/memorystore/docs/memcached/reference/rest/v1/projects.locations.instances) * How-to Guides * [Official Documentation](https://cloud.google.com/memcache/docs/creating-instances) ## Example Usage ### Memcache Instance Basic ```java package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.gcp.compute.ComputeFunctions; import com.pulumi.gcp.compute.inputs.GetNetworkArgs; import com.pulumi.gcp.compute.GlobalAddress; import com.pulumi.gcp.compute.GlobalAddressArgs; import com.pulumi.gcp.servicenetworking.Connection; import com.pulumi.gcp.servicenetworking.ConnectionArgs; import com.pulumi.gcp.memcache.Instance; import com.pulumi.gcp.memcache.InstanceArgs; import com.pulumi.gcp.memcache.inputs.InstanceNodeConfigArgs; import com.pulumi.gcp.memcache.inputs.InstanceMaintenancePolicyArgs; import java.util.List; import java.util.ArrayList; 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 memcacheNetwork = ComputeFunctions.getNetwork(GetNetworkArgs.builder() .name("test-network") .build()); var serviceRange = new GlobalAddress("serviceRange", GlobalAddressArgs.builder() .purpose("VPC_PEERING") .addressType("INTERNAL") .prefixLength(16) .network(memcacheNetwork.applyValue(getNetworkResult -> getNetworkResult.id())) .build()); var privateServiceConnection = new Connection("privateServiceConnection", ConnectionArgs.builder() .network(memcacheNetwork.applyValue(getNetworkResult -> getNetworkResult.id())) .service("servicenetworking.googleapis.com") .reservedPeeringRanges(serviceRange.name()) .build()); var instance = new Instance("instance", InstanceArgs.builder() .authorizedNetwork(privateServiceConnection.network()) .nodeConfig(InstanceNodeConfigArgs.builder() .cpuCount(1) .memorySizeMb(1024) .build()) .nodeCount(1) .memcacheVersion("MEMCACHE_1_5") .maintenancePolicy(InstanceMaintenancePolicyArgs.builder() .weeklyMaintenanceWindows(InstanceMaintenancePolicyWeeklyMaintenanceWindowArgs.builder() .day("SATURDAY") .duration("14400s") .startTime(InstanceMaintenancePolicyWeeklyMaintenanceWindowStartTimeArgs.builder() .hours(0) .minutes(30) .seconds(0) .nanos(0) .build()) .build()) .build()) .build()); } } ``` ## Import Instance can be imported using any of these accepted formats ```sh $ pulumi import gcp:memcache/instance:Instance default projects/{{project}}/locations/{{region}}/instances/{{name}} ``` ```sh $ pulumi import gcp:memcache/instance:Instance default {{project}}/{{region}}/{{name}} ``` ```sh $ pulumi import gcp:memcache/instance:Instance default {{region}}/{{name}} ``` ```sh $ pulumi import gcp:memcache/instance:Instance default {{name}} ```
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.pulumi.resources.CustomResource

        com.pulumi.resources.CustomResource.CustomResourceInternal
      • Nested classes/interfaces inherited from class com.pulumi.resources.Resource

        com.pulumi.resources.Resource.LazyField<T extends java.lang.Object>, com.pulumi.resources.Resource.LazyFields, com.pulumi.resources.Resource.ResourceInternal
    • Field Summary

      • Fields inherited from class com.pulumi.resources.Resource

        childResources, remote
    • Constructor Summary

      Constructors 
      Constructor Description
      Instance​(java.lang.String name)  
      Instance​(java.lang.String name, InstanceArgs args)  
      Instance​(java.lang.String name, InstanceArgs args, com.pulumi.resources.CustomResourceOptions options)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.pulumi.core.Output<java.lang.String> authorizedNetwork()  
      com.pulumi.core.Output<java.lang.String> createTime()  
      com.pulumi.core.Output<java.lang.String> discoveryEndpoint()  
      com.pulumi.core.Output<java.lang.String> displayName()  
      static Instance get​(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, InstanceState 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.util.Optional<java.util.Map<java.lang.String,​java.lang.String>>> labels()  
      com.pulumi.core.Output<java.util.Optional<InstanceMaintenancePolicy>> maintenancePolicy()  
      com.pulumi.core.Output<java.util.List<InstanceMaintenanceSchedule>> maintenanceSchedules()  
      com.pulumi.core.Output<java.lang.String> memcacheFullVersion()  
      com.pulumi.core.Output<java.util.List<InstanceMemcacheNode>> memcacheNodes()  
      com.pulumi.core.Output<java.util.Optional<InstanceMemcacheParameters>> memcacheParameters()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> memcacheVersion()  
      com.pulumi.core.Output<java.lang.String> name()  
      com.pulumi.core.Output<InstanceNodeConfig> nodeConfig()  
      com.pulumi.core.Output<java.lang.Integer> nodeCount()  
      com.pulumi.core.Output<java.lang.String> project()  
      com.pulumi.core.Output<java.lang.String> region()  
      com.pulumi.core.Output<java.util.List<java.lang.String>> zones()  
      • Methods inherited from class com.pulumi.resources.CustomResource

        getId, id, idFuture
      • Methods inherited from class com.pulumi.resources.Resource

        getChildResources, getResourceName, getResourceType, getUrn, pulumiChildResources, pulumiResourceName, pulumiResourceType, urn
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Instance

        public Instance​(java.lang.String name)
        Parameters:
        name - The _unique_ name of the resulting resource.
      • Instance

        public Instance​(java.lang.String name,
                        InstanceArgs args)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
      • Instance

        public Instance​(java.lang.String name,
                        InstanceArgs 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

      • authorizedNetwork

        public com.pulumi.core.Output<java.lang.String> authorizedNetwork()
        Returns:
        The full name of the GCE network to connect the instance to. If not provided, 'default' will be used.
      • createTime

        public com.pulumi.core.Output<java.lang.String> createTime()
        Returns:
        (Output) Output only. The time when the policy was created. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits
      • discoveryEndpoint

        public com.pulumi.core.Output<java.lang.String> discoveryEndpoint()
        Returns:
        Endpoint for Discovery API
      • displayName

        public com.pulumi.core.Output<java.lang.String> displayName()
        Returns:
        A user-visible name for the instance.
      • labels

        public com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.String>>> labels()
        Returns:
        Resource labels to represent user-provided metadata.
      • maintenancePolicy

        public com.pulumi.core.Output<java.util.Optional<InstanceMaintenancePolicy>> maintenancePolicy()
        Returns:
        Maintenance policy for an instance. Structure is documented below.
      • maintenanceSchedules

        public com.pulumi.core.Output<java.util.List<InstanceMaintenanceSchedule>> maintenanceSchedules()
        Returns:
        Output only. Published maintenance schedule. Structure is documented below.
      • memcacheFullVersion

        public com.pulumi.core.Output<java.lang.String> memcacheFullVersion()
        Returns:
        The full version of memcached server running on this instance.
      • memcacheNodes

        public com.pulumi.core.Output<java.util.List<InstanceMemcacheNode>> memcacheNodes()
        Returns:
        Additional information about the instance state, if available. Structure is documented below.
      • memcacheParameters

        public com.pulumi.core.Output<java.util.Optional<InstanceMemcacheParameters>> memcacheParameters()
        Returns:
        User-specified parameters for this memcache instance. Structure is documented below.
      • memcacheVersion

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> memcacheVersion()
        Returns:
        The major version of Memcached software. If not provided, latest supported version will be used. Currently the latest supported major version is MEMCACHE_1_5. The minor version will be automatically determined by our system based on the latest supported minor version. Default value is `MEMCACHE_1_5`. Possible values are: `MEMCACHE_1_5`.
      • name

        public com.pulumi.core.Output<java.lang.String> name()
        Returns:
        The resource name of the instance.
      • nodeConfig

        public com.pulumi.core.Output<InstanceNodeConfig> nodeConfig()
        Returns:
        Configuration for memcache nodes. Structure is documented below.
      • nodeCount

        public com.pulumi.core.Output<java.lang.Integer> nodeCount()
        Returns:
        Number of nodes in the memcache instance.
      • project

        public com.pulumi.core.Output<java.lang.String> project()
        Returns:
        The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
      • region

        public com.pulumi.core.Output<java.lang.String> region()
        Returns:
        The region of the Memcache instance. If it is not provided, the provider region is used.
      • zones

        public com.pulumi.core.Output<java.util.List<java.lang.String>> zones()
        Returns:
        Zones where memcache nodes should be provisioned. If not provided, all zones will be used.
      • get

        public static Instance get​(java.lang.String name,
                                   com.pulumi.core.Output<java.lang.String> id,
                                   @Nullable
                                   InstanceState 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.