AssignmentArgs

data class AssignmentArgs(val additionalData: Output<AssignmentPropertiesAdditionalDataArgs>? = null, val assignedComponent: Output<AssignedComponentItemArgs>? = null, val assignedStandard: Output<AssignedStandardItemArgs>? = null, val assignmentId: Output<String>? = null, val description: Output<String>? = null, val displayName: Output<String>? = null, val effect: Output<String>? = null, val expiresOn: Output<String>? = null, val kind: Output<String>? = null, val location: Output<String>? = null, val metadata: Output<Any>? = null, val resourceGroupName: Output<String>? = null, val scope: Output<String>? = null, val tags: Output<Map<String, String>>? = null) : ConvertibleToJava<AssignmentArgs>

Security Assignment on a resource group over a given scope Uses Azure REST API version 2021-08-01-preview. In version 2.x of the Azure Native provider, it used API version 2021-08-01-preview.

Example Usage

Define a default standard assignment

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var assignment = new AzureNative.Security.Assignment("assignment", new()
{
AssignedStandard = new AzureNative.Security.Inputs.AssignedStandardItemArgs
{
Id = "/providers/Microsoft.Security/Standards/1f3afdf9-d0c9-4c3d-847f-89da613e70a8",
},
AssignmentId = "1f3afdf9-d0c9-4c3d-847f-89da613e70a8",
Description = "Set of policies monitored by Azure Security Center for cross cloud",
DisplayName = "ASC Default",
Effect = "audit",
ResourceGroupName = "myResourceGroup",
Scope = "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/ResourceGroup/rg",
});
});
package main
import (
security "github.com/pulumi/pulumi-azure-native-sdk/security/v3"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := security.NewAssignment(ctx, "assignment", &security.AssignmentArgs{
AssignedStandard: &security.AssignedStandardItemArgs{
Id: pulumi.String("/providers/Microsoft.Security/Standards/1f3afdf9-d0c9-4c3d-847f-89da613e70a8"),
},
AssignmentId: pulumi.String("1f3afdf9-d0c9-4c3d-847f-89da613e70a8"),
Description: pulumi.String("Set of policies monitored by Azure Security Center for cross cloud"),
DisplayName: pulumi.String("ASC Default"),
Effect: pulumi.String("audit"),
ResourceGroupName: pulumi.String("myResourceGroup"),
Scope: pulumi.String("/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/ResourceGroup/rg"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.security.Assignment;
import com.pulumi.azurenative.security.AssignmentArgs;
import com.pulumi.azurenative.security.inputs.AssignedStandardItemArgs;
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 assignment = new Assignment("assignment", AssignmentArgs.builder()
.assignedStandard(AssignedStandardItemArgs.builder()
.id("/providers/Microsoft.Security/Standards/1f3afdf9-d0c9-4c3d-847f-89da613e70a8")
.build())
.assignmentId("1f3afdf9-d0c9-4c3d-847f-89da613e70a8")
.description("Set of policies monitored by Azure Security Center for cross cloud")
.displayName("ASC Default")
.effect("audit")
.resourceGroupName("myResourceGroup")
.scope("/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/ResourceGroup/rg")
.build());
}
}

Exempt Recommendation From standard and resource

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var assignment = new AzureNative.Security.Assignment("assignment", new()
{
AdditionalData = new AzureNative.Security.Inputs.AssignmentPropertiesAdditionalDataArgs
{
ExemptionCategory = "waiver",
},
AssignedComponent = new AzureNative.Security.Inputs.AssignedComponentItemArgs
{
Key = "1195afff-c881-495e-9bc5-1486211ae03f",
},
AssignedStandard = new AzureNative.Security.Inputs.AssignedStandardItemArgs
{
Id = "/providers/Microsoft.Security/Standards/1f3afdf9-d0c9-4c3d-847f-89da613e70a8",
},
AssignmentId = "1f3afdf9-d0c9-4c3d-847f-89da613e70a8",
Description = "Set of policies monitored by Azure Security Center for cross cloud",
DisplayName = "ASC Default",
Effect = "Exempt",
ExpiresOn = "2022-05-01T19:50:47.083633Z",
Metadata = new Dictionary<string, object?>
{
["ticketId"] = 12345,
},
ResourceGroupName = "myResourceGroup",
Scope = "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/ResourceGroup/rg",
});
});
package main
import (
security "github.com/pulumi/pulumi-azure-native-sdk/security/v3"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := security.NewAssignment(ctx, "assignment", &security.AssignmentArgs{
AdditionalData: &security.AssignmentPropertiesAdditionalDataArgs{
ExemptionCategory: pulumi.String("waiver"),
},
AssignedComponent: &security.AssignedComponentItemArgs{
Key: pulumi.String("1195afff-c881-495e-9bc5-1486211ae03f"),
},
AssignedStandard: &security.AssignedStandardItemArgs{
Id: pulumi.String("/providers/Microsoft.Security/Standards/1f3afdf9-d0c9-4c3d-847f-89da613e70a8"),
},
AssignmentId: pulumi.String("1f3afdf9-d0c9-4c3d-847f-89da613e70a8"),
Description: pulumi.String("Set of policies monitored by Azure Security Center for cross cloud"),
DisplayName: pulumi.String("ASC Default"),
Effect: pulumi.String("Exempt"),
ExpiresOn: pulumi.String("2022-05-01T19:50:47.083633Z"),
Metadata: pulumi.Any(map[string]interface{}{
"ticketId": 12345,
}),
ResourceGroupName: pulumi.String("myResourceGroup"),
Scope: pulumi.String("/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/ResourceGroup/rg"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.security.Assignment;
import com.pulumi.azurenative.security.AssignmentArgs;
import com.pulumi.azurenative.security.inputs.AssignmentPropertiesAdditionalDataArgs;
import com.pulumi.azurenative.security.inputs.AssignedComponentItemArgs;
import com.pulumi.azurenative.security.inputs.AssignedStandardItemArgs;
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 assignment = new Assignment("assignment", AssignmentArgs.builder()
.additionalData(AssignmentPropertiesAdditionalDataArgs.builder()
.exemptionCategory("waiver")
.build())
.assignedComponent(AssignedComponentItemArgs.builder()
.key("1195afff-c881-495e-9bc5-1486211ae03f")
.build())
.assignedStandard(AssignedStandardItemArgs.builder()
.id("/providers/Microsoft.Security/Standards/1f3afdf9-d0c9-4c3d-847f-89da613e70a8")
.build())
.assignmentId("1f3afdf9-d0c9-4c3d-847f-89da613e70a8")
.description("Set of policies monitored by Azure Security Center for cross cloud")
.displayName("ASC Default")
.effect("Exempt")
.expiresOn("2022-05-01T19:50:47.083633Z")
.metadata(Map.of("ticketId", 12345))
.resourceGroupName("myResourceGroup")
.scope("/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/ResourceGroup/rg")
.build());
}
}

Import

An existing resource can be imported using its type token, name, and identifier, e.g.

$ pulumi import azure-native:security:Assignment 1f3afdf9-d0c9-4c3d-847f-89da613e70a8 /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/assignments/{assignmentId}

Constructors

Link copied to clipboard
constructor(additionalData: Output<AssignmentPropertiesAdditionalDataArgs>? = null, assignedComponent: Output<AssignedComponentItemArgs>? = null, assignedStandard: Output<AssignedStandardItemArgs>? = null, assignmentId: Output<String>? = null, description: Output<String>? = null, displayName: Output<String>? = null, effect: Output<String>? = null, expiresOn: Output<String>? = null, kind: Output<String>? = null, location: Output<String>? = null, metadata: Output<Any>? = null, resourceGroupName: Output<String>? = null, scope: Output<String>? = null, tags: Output<Map<String, String>>? = null)

Properties

Link copied to clipboard

Additional data about the assignment

Link copied to clipboard

Component item with key as applied to this standard assignment over the given scope

Link copied to clipboard

Standard item with key as applied to this standard assignment over the given scope

Link copied to clipboard
val assignmentId: Output<String>? = null

The security assignment key - unique key for the standard assignment

Link copied to clipboard
val description: Output<String>? = null

description of the standardAssignment

Link copied to clipboard
val displayName: Output<String>? = null

display name of the standardAssignment

Link copied to clipboard
val effect: Output<String>? = null

expected effect of this assignment (Disable/Exempt/etc)

Link copied to clipboard
val expiresOn: Output<String>? = null

Expiration date of this assignment as a full ISO date

Link copied to clipboard
val kind: Output<String>? = null

Kind of the resource

Link copied to clipboard
val location: Output<String>? = null

Location where the resource is stored

Link copied to clipboard
val metadata: Output<Any>? = null

The assignment metadata. Metadata is an open ended object and is typically a collection of key value pairs.

Link copied to clipboard
val resourceGroupName: Output<String>? = null

The name of the resource group within the user's subscription. The name is case insensitive.

Link copied to clipboard
val scope: Output<String>? = null

Scope to which the standardAssignment applies - can be a subscription path or a resource group under that subscription

Link copied to clipboard
val tags: Output<Map<String, String>>? = null

A list of key value pairs that describe the resource.

Functions

Link copied to clipboard
open override fun toJava(): AssignmentArgs