All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.azurenative.azurearcdata.PostgresInstance Maven / Gradle / Ivy

There is a newer version: 2.82.0
Show newest version
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package com.pulumi.azurenative.azurearcdata;

import com.pulumi.azurenative.Utilities;
import com.pulumi.azurenative.azurearcdata.PostgresInstanceArgs;
import com.pulumi.azurenative.azurearcdata.outputs.ExtendedLocationResponse;
import com.pulumi.azurenative.azurearcdata.outputs.PostgresInstancePropertiesResponse;
import com.pulumi.azurenative.azurearcdata.outputs.PostgresInstanceSkuResponse;
import com.pulumi.azurenative.azurearcdata.outputs.SystemDataResponse;
import com.pulumi.core.Alias;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import java.lang.String;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * A Postgres Instance.
 * Azure REST API version: 2023-01-15-preview. Prior API version in Azure Native 1.x: 2021-06-01-preview.
 * 
 * Other available API versions: 2024-01-01, 2024-05-01-preview.
 * 
 * ## Example Usage
 * ### Create or update a Postgres Instance.
 * 
 * 
 * {@code
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.azurenative.azurearcdata.PostgresInstance;
 * import com.pulumi.azurenative.azurearcdata.PostgresInstanceArgs;
 * import com.pulumi.azurenative.azurearcdata.inputs.ExtendedLocationArgs;
 * import com.pulumi.azurenative.azurearcdata.inputs.PostgresInstancePropertiesArgs;
 * import com.pulumi.azurenative.azurearcdata.inputs.BasicLoginInformationArgs;
 * import com.pulumi.azurenative.azurearcdata.inputs.PostgresInstanceSkuArgs;
 * 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) {
 *         var postgresInstance = new PostgresInstance("postgresInstance", PostgresInstanceArgs.builder()
 *             .extendedLocation(ExtendedLocationArgs.builder()
 *                 .name("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/testrg/providers/Microsoft.ExtendedLocation/customLocations/arclocation")
 *                 .type("CustomLocation")
 *                 .build())
 *             .location("eastus")
 *             .postgresInstanceName("testpostgresInstance")
 *             .properties(PostgresInstancePropertiesArgs.builder()
 *                 .admin("admin")
 *                 .basicLoginInformation(BasicLoginInformationArgs.builder()
 *                     .password("********")
 *                     .username("username")
 *                     .build())
 *                 .dataControllerId("dataControllerId")
 *                 .k8sRaw(Map.ofEntries(
 *                     Map.entry("apiVersion", "apiVersion"),
 *                     Map.entry("kind", "postgresql-12"),
 *                     Map.entry("metadata", Map.ofEntries(
 *                         Map.entry("creationTimestamp", "2020-08-25T14:55:10Z"),
 *                         Map.entry("generation", 1),
 *                         Map.entry("name", "pg1"),
 *                         Map.entry("namespace", "test"),
 *                         Map.entry("resourceVersion", "527780"),
 *                         Map.entry("selfLink", "/apis/arcdata.microsoft.com/v1alpha1/namespaces/test/postgresql-12s/pg1"),
 *                         Map.entry("uid", "1111aaaa-ffff-ffff-ffff-99999aaaaaaa")
 *                     )),
 *                     Map.entry("spec", Map.ofEntries(
 *                         Map.entry("backups", Map.ofEntries(
 *                             Map.entry("deltaMinutes", 3),
 *                             Map.entry("fullMinutes", 10),
 *                             Map.entry("tiers", Map.ofEntries(
 *                                 Map.entry("retention", Map.ofEntries(
 *                                     Map.entry("maximums",                                     
 *                                         "6",
 *                                         "512MB"),
 *                                     Map.entry("minimums", "3")
 *                                 )),
 *                                 Map.entry("storage", Map.of("volumeSize", "1Gi"))
 *                             ))
 *                         )),
 *                         Map.entry("engine", Map.of("extensions", Map.of("name", "citus"))),
 *                         Map.entry("scale", Map.of("shards", 3)),
 *                         Map.entry("scheduling", Map.of("default", Map.of("resources", Map.of("requests", Map.of("memory", "256Mi"))))),
 *                         Map.entry("service", Map.of("type", "NodePort")),
 *                         Map.entry("storage", Map.ofEntries(
 *                             Map.entry("data", Map.ofEntries(
 *                                 Map.entry("className", "local-storage"),
 *                                 Map.entry("size", "5Gi")
 *                             )),
 *                             Map.entry("logs", Map.ofEntries(
 *                                 Map.entry("className", "local-storage"),
 *                                 Map.entry("size", "5Gi")
 *                             ))
 *                         ))
 *                     )),
 *                     Map.entry("status", Map.ofEntries(
 *                         Map.entry("externalEndpoint", null),
 *                         Map.entry("readyPods", "4/4"),
 *                         Map.entry("state", "Ready")
 *                     ))
 *                 ))
 *                 .build())
 *             .resourceGroupName("testrg")
 *             .sku(PostgresInstanceSkuArgs.builder()
 *                 .dev(true)
 *                 .name("default")
 *                 .tier("Hyperscale")
 *                 .build())
 *             .build());
 * 
 *     }
 * }
 * 
 * }
 * 
* * ## Import * * An existing resource can be imported using its type token, name, and identifier, e.g. * * ```sh * $ pulumi import azure-native:azurearcdata:PostgresInstance testpostgresInstance /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureArcData/postgresInstances/{postgresInstanceName} * ``` * */ @ResourceType(type="azure-native:azurearcdata:PostgresInstance") public class PostgresInstance extends com.pulumi.resources.CustomResource { /** * The extendedLocation of the resource. * */ @Export(name="extendedLocation", refs={ExtendedLocationResponse.class}, tree="[0]") private Output extendedLocation; /** * @return The extendedLocation of the resource. * */ public Output> extendedLocation() { return Codegen.optional(this.extendedLocation); } /** * The geo-location where the resource lives * */ @Export(name="location", refs={String.class}, tree="[0]") private Output location; /** * @return The geo-location where the resource lives * */ public Output location() { return this.location; } /** * The name of the resource * */ @Export(name="name", refs={String.class}, tree="[0]") private Output name; /** * @return The name of the resource * */ public Output name() { return this.name; } /** * null * */ @Export(name="properties", refs={PostgresInstancePropertiesResponse.class}, tree="[0]") private Output properties; /** * @return null * */ public Output properties() { return this.properties; } /** * Resource sku. * */ @Export(name="sku", refs={PostgresInstanceSkuResponse.class}, tree="[0]") private Output sku; /** * @return Resource sku. * */ public Output> sku() { return Codegen.optional(this.sku); } /** * Azure Resource Manager metadata containing createdBy and modifiedBy information. * */ @Export(name="systemData", refs={SystemDataResponse.class}, tree="[0]") private Output systemData; /** * @return Azure Resource Manager metadata containing createdBy and modifiedBy information. * */ public Output systemData() { return this.systemData; } /** * Resource tags. * */ @Export(name="tags", refs={Map.class,String.class}, tree="[0,1,1]") private Output> tags; /** * @return Resource tags. * */ public Output>> tags() { return Codegen.optional(this.tags); } /** * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" * */ @Export(name="type", refs={String.class}, tree="[0]") private Output type; /** * @return The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" * */ public Output type() { return this.type; } /** * * @param name The _unique_ name of the resulting resource. */ public PostgresInstance(java.lang.String name) { this(name, PostgresInstanceArgs.Empty); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. */ public PostgresInstance(java.lang.String name, PostgresInstanceArgs args) { this(name, args, null); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. * @param options A bag of options that control this resource's behavior. */ public PostgresInstance(java.lang.String name, PostgresInstanceArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure-native:azurearcdata:PostgresInstance", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false); } private PostgresInstance(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure-native:azurearcdata:PostgresInstance", name, null, makeResourceOptions(options, id), false); } private static PostgresInstanceArgs makeArgs(PostgresInstanceArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { if (options != null && options.getUrn().isPresent()) { return null; } return args == null ? PostgresInstanceArgs.Empty : args; } private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output id) { var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder() .version(Utilities.getVersion()) .aliases(List.of( Output.of(Alias.builder().type("azure-native:azurearcdata/v20210601preview:PostgresInstance").build()), Output.of(Alias.builder().type("azure-native:azurearcdata/v20210701preview:PostgresInstance").build()), Output.of(Alias.builder().type("azure-native:azurearcdata/v20220301preview:PostgresInstance").build()), Output.of(Alias.builder().type("azure-native:azurearcdata/v20220615preview:PostgresInstance").build()), Output.of(Alias.builder().type("azure-native:azurearcdata/v20230115preview:PostgresInstance").build()), Output.of(Alias.builder().type("azure-native:azurearcdata/v20240101:PostgresInstance").build()), Output.of(Alias.builder().type("azure-native:azurearcdata/v20240501preview:PostgresInstance").build()) )) .build(); return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id); } /** * Get an existing Host 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 options Optional settings to control the behavior of the CustomResource. */ public static PostgresInstance get(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) { return new PostgresInstance(name, id, options); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy