Workspace
Manages the subscription’s Security Center Workspace.
NOTE: Owner access permission is required.
NOTE: The subscription’s pricing model can not be
Freefor this to have any affect.
Example Usage
using Pulumi;
using Azure = Pulumi.Azure;
class MyStack : Stack
{
public MyStack()
{
var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new Azure.Core.ResourceGroupArgs
{
Location = "westus",
});
var exampleAnalyticsWorkspace = new Azure.OperationalInsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", new Azure.OperationalInsights.AnalyticsWorkspaceArgs
{
Location = exampleResourceGroup.Location,
ResourceGroupName = exampleResourceGroup.Name,
Sku = "PerGB2018",
});
var exampleWorkspace = new Azure.SecurityCenter.Workspace("exampleWorkspace", new Azure.SecurityCenter.WorkspaceArgs
{
Scope = "/subscriptions/00000000-0000-0000-0000-000000000000",
WorkspaceId = exampleAnalyticsWorkspace.Id,
});
}
}
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v3/go/azure/core"
"github.com/pulumi/pulumi-azure/sdk/v3/go/azure/operationalinsights"
"github.com/pulumi/pulumi-azure/sdk/v3/go/azure/securitycenter"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{
Location: pulumi.String("westus"),
})
if err != nil {
return err
}
exampleAnalyticsWorkspace, err := operationalinsights.NewAnalyticsWorkspace(ctx, "exampleAnalyticsWorkspace", &operationalinsights.AnalyticsWorkspaceArgs{
Location: exampleResourceGroup.Location,
ResourceGroupName: exampleResourceGroup.Name,
Sku: pulumi.String("PerGB2018"),
})
if err != nil {
return err
}
_, err = securitycenter.NewWorkspace(ctx, "exampleWorkspace", &securitycenter.WorkspaceArgs{
Scope: pulumi.String("/subscriptions/00000000-0000-0000-0000-000000000000"),
WorkspaceId: exampleAnalyticsWorkspace.ID(),
})
if err != nil {
return err
}
return nil
})
}import pulumi
import pulumi_azure as azure
example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="westus")
example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace",
location=example_resource_group.location,
resource_group_name=example_resource_group.name,
sku="PerGB2018")
example_workspace = azure.securitycenter.Workspace("exampleWorkspace",
scope="/subscriptions/00000000-0000-0000-0000-000000000000",
workspace_id=example_analytics_workspace.id)import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "westus"});
const exampleAnalyticsWorkspace = new azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", {
location: exampleResourceGroup.location,
resourceGroupName: exampleResourceGroup.name,
sku: "PerGB2018",
});
const exampleWorkspace = new azure.securitycenter.Workspace("exampleWorkspace", {
scope: "/subscriptions/00000000-0000-0000-0000-000000000000",
workspaceId: exampleAnalyticsWorkspace.id,
});Create a Workspace Resource
new Workspace(name: string, args: WorkspaceArgs, opts?: CustomResourceOptions);def Workspace(resource_name, opts=None, scope=None, workspace_id=None, __props__=None);func NewWorkspace(ctx *Context, name string, args WorkspaceArgs, opts ...ResourceOption) (*Workspace, error)public Workspace(string name, WorkspaceArgs args, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args WorkspaceArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- opts ResourceOptions
- A bag of options that control this resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args WorkspaceArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args WorkspaceArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
Workspace Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The Workspace resource accepts the following input properties:
- Scope string
The scope of VMs to send their security data to the desired workspace, unless overridden by a setting with more specific scope.
- Workspace
Id string The ID of the Log Analytics Workspace to save the data in.
- Scope string
The scope of VMs to send their security data to the desired workspace, unless overridden by a setting with more specific scope.
- Workspace
Id string The ID of the Log Analytics Workspace to save the data in.
- scope string
The scope of VMs to send their security data to the desired workspace, unless overridden by a setting with more specific scope.
- workspace
Id string The ID of the Log Analytics Workspace to save the data in.
- scope str
The scope of VMs to send their security data to the desired workspace, unless overridden by a setting with more specific scope.
- workspace_
id str The ID of the Log Analytics Workspace to save the data in.
Outputs
All input properties are implicitly available as output properties. Additionally, the Workspace resource produces the following output properties:
Look up an Existing Workspace Resource
Get an existing Workspace resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: WorkspaceState, opts?: CustomResourceOptions): Workspacestatic get(resource_name, id, opts=None, scope=None, workspace_id=None, __props__=None);func GetWorkspace(ctx *Context, name string, id IDInput, state *WorkspaceState, opts ...ResourceOption) (*Workspace, error)public static Workspace Get(string name, Input<string> id, WorkspaceState? state, CustomResourceOptions? opts = null)- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
The following state arguments are supported:
- Scope string
The scope of VMs to send their security data to the desired workspace, unless overridden by a setting with more specific scope.
- Workspace
Id string The ID of the Log Analytics Workspace to save the data in.
- Scope string
The scope of VMs to send their security data to the desired workspace, unless overridden by a setting with more specific scope.
- Workspace
Id string The ID of the Log Analytics Workspace to save the data in.
- scope string
The scope of VMs to send their security data to the desired workspace, unless overridden by a setting with more specific scope.
- workspace
Id string The ID of the Log Analytics Workspace to save the data in.
- scope str
The scope of VMs to send their security data to the desired workspace, unless overridden by a setting with more specific scope.
- workspace_
id str The ID of the Log Analytics Workspace to save the data in.
Package Details
- Repository
- https://github.com/pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azurermTerraform Provider.