com.pulumi.azure.synapse.SqlPoolVulnerabilityAssessmentBaseline 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.synapse;
import com.pulumi.azure.Utilities;
import com.pulumi.azure.synapse.SqlPoolVulnerabilityAssessmentBaselineArgs;
import com.pulumi.azure.synapse.inputs.SqlPoolVulnerabilityAssessmentBaselineState;
import com.pulumi.azure.synapse.outputs.SqlPoolVulnerabilityAssessmentBaselineBaseline;
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.Optional;
import javax.annotation.Nullable;
/**
* Manages a Synapse SQL Pool Vulnerability Assessment Rule Baseline.
*
* ## 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.storage.Account;
* import com.pulumi.azure.storage.AccountArgs;
* import com.pulumi.azure.storage.DataLakeGen2Filesystem;
* import com.pulumi.azure.storage.DataLakeGen2FilesystemArgs;
* import com.pulumi.azure.synapse.Workspace;
* import com.pulumi.azure.synapse.WorkspaceArgs;
* import com.pulumi.azure.synapse.inputs.WorkspaceIdentityArgs;
* import com.pulumi.azure.synapse.SqlPool;
* import com.pulumi.azure.synapse.SqlPoolArgs;
* import com.pulumi.azure.storage.Container;
* import com.pulumi.azure.storage.ContainerArgs;
* import com.pulumi.azure.synapse.SqlPoolSecurityAlertPolicy;
* import com.pulumi.azure.synapse.SqlPoolSecurityAlertPolicyArgs;
* import com.pulumi.azure.synapse.SqlPoolVulnerabilityAssessment;
* import com.pulumi.azure.synapse.SqlPoolVulnerabilityAssessmentArgs;
* import com.pulumi.azure.synapse.SqlPoolVulnerabilityAssessmentBaseline;
* import com.pulumi.azure.synapse.SqlPoolVulnerabilityAssessmentBaselineArgs;
* import com.pulumi.azure.synapse.inputs.SqlPoolVulnerabilityAssessmentBaselineBaselineArgs;
* 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 }{{@code
* public static void main(String[] args) }{{@code
* Pulumi.run(App::stack);
* }}{@code
*
* public static void stack(Context ctx) }{{@code
* var example = new ResourceGroup("example", ResourceGroupArgs.builder()
* .name("example")
* .location("west europe")
* .build());
*
* var exampleAccount = new Account("exampleAccount", AccountArgs.builder()
* .name("example")
* .resourceGroupName(example.name())
* .location(example.location())
* .accountKind("BlobStorage")
* .accountTier("Standard")
* .accountReplicationType("LRS")
* .build());
*
* var exampleDataLakeGen2Filesystem = new DataLakeGen2Filesystem("exampleDataLakeGen2Filesystem", DataLakeGen2FilesystemArgs.builder()
* .name("example")
* .storageAccountId(exampleAccount.id())
* .build());
*
* var exampleWorkspace = new Workspace("exampleWorkspace", WorkspaceArgs.builder()
* .name("example")
* .resourceGroupName(example.name())
* .location(example.location())
* .storageDataLakeGen2FilesystemId(exampleDataLakeGen2Filesystem.id())
* .sqlAdministratorLogin("sqladminuser")
* .sqlAdministratorLoginPassword("H}{@literal @}{@code Sh1CoR3!")
* .identity(WorkspaceIdentityArgs.builder()
* .type("SystemAssigned")
* .build())
* .build());
*
* var exampleSqlPool = new SqlPool("exampleSqlPool", SqlPoolArgs.builder()
* .name("example")
* .synapseWorkspaceId(exampleWorkspace.id())
* .skuName("DW100c")
* .createMode("Default")
* .build());
*
* var exampleContainer = new Container("exampleContainer", ContainerArgs.builder()
* .name("example")
* .storageAccountName(exampleAccount.name())
* .containerAccessType("private")
* .build());
*
* var exampleSqlPoolSecurityAlertPolicy = new SqlPoolSecurityAlertPolicy("exampleSqlPoolSecurityAlertPolicy", SqlPoolSecurityAlertPolicyArgs.builder()
* .sqlPoolId(exampleSqlPool.id())
* .policyState("Enabled")
* .storageEndpoint(exampleAccount.primaryBlobEndpoint())
* .storageAccountAccessKey(exampleAccount.primaryAccessKey())
* .build());
*
* var exampleSqlPoolVulnerabilityAssessment = new SqlPoolVulnerabilityAssessment("exampleSqlPoolVulnerabilityAssessment", SqlPoolVulnerabilityAssessmentArgs.builder()
* .sqlPoolSecurityAlertPolicyId(exampleSqlPoolSecurityAlertPolicy.id())
* .storageContainerPath(Output.tuple(exampleAccount.primaryBlobEndpoint(), exampleContainer.name()).applyValue(values -> }{{@code
* var primaryBlobEndpoint = values.t1;
* var name = values.t2;
* return String.format("%s%s/", primaryBlobEndpoint,name);
* }}{@code ))
* .storageAccountAccessKey(exampleAccount.primaryAccessKey())
* .build());
*
* var exampleSqlPoolVulnerabilityAssessmentBaseline = new SqlPoolVulnerabilityAssessmentBaseline("exampleSqlPoolVulnerabilityAssessmentBaseline", SqlPoolVulnerabilityAssessmentBaselineArgs.builder()
* .name("default")
* .ruleName("VA1017")
* .sqlPoolVulnerabilityAssessmentId(exampleSqlPoolVulnerabilityAssessment.id())
* .baselines(
* SqlPoolVulnerabilityAssessmentBaselineBaselineArgs.builder()
* .results(
* "userA",
* "SELECT")
* .build(),
* SqlPoolVulnerabilityAssessmentBaselineBaselineArgs.builder()
* .results(
* "userB",
* "SELECT")
* .build())
* .build());
*
* }}{@code
* }}{@code
* }
*
* <!--End PulumiCodeChooser -->
*
* ## Import
*
* Synapse SQL Pool Vulnerability Assessment Rule Baselines can be imported using the `resource id`, e.g.
*
* ```sh
* $ pulumi import azure:synapse/sqlPoolVulnerabilityAssessmentBaseline:SqlPoolVulnerabilityAssessmentBaseline example /subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Synapse/workspaces/workspace1/sqlPools/sqlPool1/vulnerabilityAssessments/default/rules/rule1/baselines/baseline1
* ```
*
*/
@ResourceType(type="azure:synapse/sqlPoolVulnerabilityAssessmentBaseline:SqlPoolVulnerabilityAssessmentBaseline")
public class SqlPoolVulnerabilityAssessmentBaseline extends com.pulumi.resources.CustomResource {
/**
* One or more `baseline` blocks as defined below.
*
*/
@Export(name="baselines", refs={List.class,SqlPoolVulnerabilityAssessmentBaselineBaseline.class}, tree="[0,1]")
private Output* @Nullable */ List> baselines;
/**
* @return One or more `baseline` blocks as defined below.
*
*/
public Output>> baselines() {
return Codegen.optional(this.baselines);
}
/**
* The name which should be used for this Synapse SQL Pool Vulnerability Assessment Rule Baseline.
*
*/
@Export(name="name", refs={String.class}, tree="[0]")
private Output name;
/**
* @return The name which should be used for this Synapse SQL Pool Vulnerability Assessment Rule Baseline.
*
*/
public Output name() {
return this.name;
}
/**
* The ID of the vulnerability assessment rule.
*
*/
@Export(name="ruleName", refs={String.class}, tree="[0]")
private Output ruleName;
/**
* @return The ID of the vulnerability assessment rule.
*
*/
public Output ruleName() {
return this.ruleName;
}
/**
* The ID of the Synapse SQL Pool Vulnerability Assessment. Changing this forces a new Synapse SQL Pool Vulnerability Assessment Rule Baseline to be created.
*
*/
@Export(name="sqlPoolVulnerabilityAssessmentId", refs={String.class}, tree="[0]")
private Output sqlPoolVulnerabilityAssessmentId;
/**
* @return The ID of the Synapse SQL Pool Vulnerability Assessment. Changing this forces a new Synapse SQL Pool Vulnerability Assessment Rule Baseline to be created.
*
*/
public Output sqlPoolVulnerabilityAssessmentId() {
return this.sqlPoolVulnerabilityAssessmentId;
}
/**
*
* @param name The _unique_ name of the resulting resource.
*/
public SqlPoolVulnerabilityAssessmentBaseline(java.lang.String name) {
this(name, SqlPoolVulnerabilityAssessmentBaselineArgs.Empty);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
*/
public SqlPoolVulnerabilityAssessmentBaseline(java.lang.String name, SqlPoolVulnerabilityAssessmentBaselineArgs 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 SqlPoolVulnerabilityAssessmentBaseline(java.lang.String name, SqlPoolVulnerabilityAssessmentBaselineArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure:synapse/sqlPoolVulnerabilityAssessmentBaseline:SqlPoolVulnerabilityAssessmentBaseline", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false);
}
private SqlPoolVulnerabilityAssessmentBaseline(java.lang.String name, Output id, @Nullable SqlPoolVulnerabilityAssessmentBaselineState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure:synapse/sqlPoolVulnerabilityAssessmentBaseline:SqlPoolVulnerabilityAssessmentBaseline", name, state, makeResourceOptions(options, id), false);
}
private static SqlPoolVulnerabilityAssessmentBaselineArgs makeArgs(SqlPoolVulnerabilityAssessmentBaselineArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
if (options != null && options.getUrn().isPresent()) {
return null;
}
return args == null ? SqlPoolVulnerabilityAssessmentBaselineArgs.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 SqlPoolVulnerabilityAssessmentBaseline get(java.lang.String name, Output id, @Nullable SqlPoolVulnerabilityAssessmentBaselineState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
return new SqlPoolVulnerabilityAssessmentBaseline(name, id, state, options);
}
}