com.pulumi.azure.securitycenter.Workspace 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.securitycenter;
import com.pulumi.azure.Utilities;
import com.pulumi.azure.securitycenter.WorkspaceArgs;
import com.pulumi.azure.securitycenter.inputs.WorkspaceState;
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;
/**
* Manages the subscription's Security Center Workspace.
*
* > **NOTE:** Owner access permission is required.
*
* ## 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.operationalinsights.AnalyticsWorkspace;
* import com.pulumi.azure.operationalinsights.AnalyticsWorkspaceArgs;
* import com.pulumi.azure.securitycenter.Workspace;
* import com.pulumi.azure.securitycenter.WorkspaceArgs;
* 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("tfex-security-workspace")
* .location("West Europe")
* .build());
*
* var exampleAnalyticsWorkspace = new AnalyticsWorkspace("exampleAnalyticsWorkspace", AnalyticsWorkspaceArgs.builder()
* .name("tfex-security-workspace")
* .location(example.location())
* .resourceGroupName(example.name())
* .sku("PerGB2018")
* .build());
*
* var exampleWorkspace = new Workspace("exampleWorkspace", WorkspaceArgs.builder()
* .scope("/subscriptions/00000000-0000-0000-0000-000000000000")
* .workspaceId(exampleAnalyticsWorkspace.id())
* .build());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
* ## Import
*
* The contact can be imported using the `resource id`, e.g.
*
* ```sh
* $ pulumi import azure:securitycenter/workspace:Workspace example /subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Security/workspaceSettings/default
* ```
*
*/
@ResourceType(type="azure:securitycenter/workspace:Workspace")
public class Workspace extends com.pulumi.resources.CustomResource {
/**
* The scope of VMs to send their security data to the desired workspace, unless overridden by a setting with more specific scope.
*
*/
@Export(name="scope", refs={String.class}, tree="[0]")
private Output scope;
/**
* @return The scope of VMs to send their security data to the desired workspace, unless overridden by a setting with more specific scope.
*
*/
public Output scope() {
return this.scope;
}
/**
* The ID of the Log Analytics Workspace to save the data in.
*
*/
@Export(name="workspaceId", refs={String.class}, tree="[0]")
private Output workspaceId;
/**
* @return The ID of the Log Analytics Workspace to save the data in.
*
*/
public Output workspaceId() {
return this.workspaceId;
}
/**
*
* @param name The _unique_ name of the resulting resource.
*/
public Workspace(java.lang.String name) {
this(name, WorkspaceArgs.Empty);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
*/
public Workspace(java.lang.String name, WorkspaceArgs 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 Workspace(java.lang.String name, WorkspaceArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure:securitycenter/workspace:Workspace", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false);
}
private Workspace(java.lang.String name, Output id, @Nullable WorkspaceState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure:securitycenter/workspace:Workspace", name, state, makeResourceOptions(options, id), false);
}
private static WorkspaceArgs makeArgs(WorkspaceArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
if (options != null && options.getUrn().isPresent()) {
return null;
}
return args == null ? WorkspaceArgs.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 Workspace get(java.lang.String name, Output id, @Nullable WorkspaceState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
return new Workspace(name, id, state, options);
}
}