com.pulumi.azure.mssql.OutboundFirewallRule Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure Show documentation
Show all versions of azure Show documentation
A Pulumi package for creating and managing Microsoft Azure cloud resources, based on the Terraform azurerm provider. We recommend using the [Azure Native provider](https://github.com/pulumi/pulumi-azure-native) to provision Azure infrastructure. Azure Native provides complete coverage of Azure resources and same-day access to new resources and resource updates.
// *** 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.azure.mssql;
import com.pulumi.azure.Utilities;
import com.pulumi.azure.mssql.OutboundFirewallRuleArgs;
import com.pulumi.azure.mssql.inputs.OutboundFirewallRuleState;
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 javax.annotation.Nullable;
/**
* Allows you to manage an Azure SQL Outbound Firewall Rule.
*
* ## Example Usage
*
* <!--Start PulumiCodeChooser -->
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azure.core.ResourceGroup;
* import com.pulumi.azure.core.ResourceGroupArgs;
* import com.pulumi.azure.mssql.Server;
* import com.pulumi.azure.mssql.ServerArgs;
* import com.pulumi.azure.mssql.OutboundFirewallRule;
* import com.pulumi.azure.mssql.OutboundFirewallRuleArgs;
* 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 example = new ResourceGroup("example", ResourceGroupArgs.builder()
* .name("example-resources")
* .location("West Europe")
* .build());
*
* var exampleServer = new Server("exampleServer", ServerArgs.builder()
* .name("mysqlserver")
* .resourceGroupName(example.name())
* .location(example.location())
* .version("12.0")
* .administratorLogin("4dm1n157r470r")
* .administratorLoginPassword("4-v3ry-53cr37-p455w0rd")
* .outboundNetworkRestrictionEnabled(true)
* .build());
*
* var exampleOutboundFirewallRule = new OutboundFirewallRule("exampleOutboundFirewallRule", OutboundFirewallRuleArgs.builder()
* .name("sqlexamplefdqn.database.windows.net")
* .serverId(exampleServer.id())
* .build());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
* ## Import
*
* SQL Outbound Firewall Rules can be imported using the `resource id`, e.g.
*
* ```sh
* $ pulumi import azure:mssql/outboundFirewallRule:OutboundFirewallRule rule1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresourcegroup/providers/Microsoft.Sql/servers/myserver/outboundFirewallRules/fqdn1
* ```
*
*/
@ResourceType(type="azure:mssql/outboundFirewallRule:OutboundFirewallRule")
public class OutboundFirewallRule extends com.pulumi.resources.CustomResource {
/**
* The name of the outbound firewall rule. This should be a FQDN. Changing this forces a new resource to be created.
*
*/
@Export(name="name", refs={String.class}, tree="[0]")
private Output name;
/**
* @return The name of the outbound firewall rule. This should be a FQDN. Changing this forces a new resource to be created.
*
*/
public Output name() {
return this.name;
}
/**
* The resource ID of the SQL Server on which to create the Outbound Firewall Rule. Changing this forces a new resource to be created.
*
*/
@Export(name="serverId", refs={String.class}, tree="[0]")
private Output serverId;
/**
* @return The resource ID of the SQL Server on which to create the Outbound Firewall Rule. Changing this forces a new resource to be created.
*
*/
public Output serverId() {
return this.serverId;
}
/**
*
* @param name The _unique_ name of the resulting resource.
*/
public OutboundFirewallRule(java.lang.String name) {
this(name, OutboundFirewallRuleArgs.Empty);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
*/
public OutboundFirewallRule(java.lang.String name, OutboundFirewallRuleArgs 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 OutboundFirewallRule(java.lang.String name, OutboundFirewallRuleArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure:mssql/outboundFirewallRule:OutboundFirewallRule", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false);
}
private OutboundFirewallRule(java.lang.String name, Output id, @Nullable OutboundFirewallRuleState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure:mssql/outboundFirewallRule:OutboundFirewallRule", name, state, makeResourceOptions(options, id), false);
}
private static OutboundFirewallRuleArgs makeArgs(OutboundFirewallRuleArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
if (options != null && options.getUrn().isPresent()) {
return null;
}
return args == null ? OutboundFirewallRuleArgs.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())
.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 state
* @param options Optional settings to control the behavior of the CustomResource.
*/
public static OutboundFirewallRule get(java.lang.String name, Output id, @Nullable OutboundFirewallRuleState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
return new OutboundFirewallRule(name, id, state, options);
}
}