All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.azurenative.security.Automation Maven / Gradle / Ivy

There is a newer version: 2.78.0
Show newest version
// *** 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.azurenative.security;

import com.pulumi.azurenative.Utilities;
import com.pulumi.azurenative.security.AutomationArgs;
import com.pulumi.azurenative.security.outputs.AutomationActionEventHubResponse;
import com.pulumi.azurenative.security.outputs.AutomationActionLogicAppResponse;
import com.pulumi.azurenative.security.outputs.AutomationActionWorkspaceResponse;
import com.pulumi.azurenative.security.outputs.AutomationScopeResponse;
import com.pulumi.azurenative.security.outputs.AutomationSourceResponse;
import com.pulumi.core.Alias;
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.Boolean;
import java.lang.Object;
import java.lang.String;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * The security automation resource.
 * Azure REST API version: 2019-01-01-preview. Prior API version in Azure Native 1.x: 2019-01-01-preview.
 * 
 * Other available API versions: 2023-12-01-preview.
 * 
 * ## Example Usage
 * ### Create or update a security automation for all assessments (including all severities)
 * 
 * 
 * {@code
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.azurenative.security.Automation;
 * import com.pulumi.azurenative.security.AutomationArgs;
 * import com.pulumi.azurenative.security.inputs.AutomationScopeArgs;
 * import com.pulumi.azurenative.security.inputs.AutomationSourceArgs;
 * 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 automation = new Automation("automation", AutomationArgs.builder()
 *             .actions(AutomationActionLogicAppArgs.builder()
 *                 .actionType("LogicApp")
 *                 .logicAppResourceId("/subscriptions/e54a4a18-5b94-4f90-9471-bd3decad8a2e/resourceGroups/sample/providers/Microsoft.Logic/workflows/MyTest1")
 *                 .uri("https://exampleTriggerUri1.com")
 *                 .build())
 *             .automationName("exampleAutomation")
 *             .description("An example of a security automation that triggers one LogicApp resource (myTest1) on any security assessment")
 *             .isEnabled(true)
 *             .location("Central US")
 *             .resourceGroupName("exampleResourceGroup")
 *             .scopes(AutomationScopeArgs.builder()
 *                 .description("A description that helps to identify this scope - for example: security assessments that relate to the resource group myResourceGroup within the subscription a5caac9c-5c04-49af-b3d0-e204f40345d5")
 *                 .scopePath("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/myResourceGroup")
 *                 .build())
 *             .sources(AutomationSourceArgs.builder()
 *                 .eventSource("Assessments")
 *                 .build())
 *             .tags()
 *             .build());
 * 
 *     }
 * }
 * 
 * }
 * 
* ### Create or update a security automation for all high severity assessments * *
 * {@code
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.azurenative.security.Automation;
 * import com.pulumi.azurenative.security.AutomationArgs;
 * import com.pulumi.azurenative.security.inputs.AutomationScopeArgs;
 * import com.pulumi.azurenative.security.inputs.AutomationSourceArgs;
 * 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 automation = new Automation("automation", AutomationArgs.builder()
 *             .actions(AutomationActionLogicAppArgs.builder()
 *                 .actionType("LogicApp")
 *                 .logicAppResourceId("/subscriptions/e54a4a18-5b94-4f90-9471-bd3decad8a2e/resourceGroups/sample/providers/Microsoft.Logic/workflows/MyTest1")
 *                 .uri("https://exampleTriggerUri1.com")
 *                 .build())
 *             .automationName("exampleAutomation")
 *             .description("An example of a security automation that triggers one LogicApp resource (myTest1) on any high severity security assessment")
 *             .isEnabled(true)
 *             .location("Central US")
 *             .resourceGroupName("exampleResourceGroup")
 *             .scopes(AutomationScopeArgs.builder()
 *                 .description("A description that helps to identify this scope - for example: security assessments that relate to the resource group myResourceGroup within the subscription a5caac9c-5c04-49af-b3d0-e204f40345d5")
 *                 .scopePath("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/myResourceGroup")
 *                 .build())
 *             .sources(AutomationSourceArgs.builder()
 *                 .eventSource("Assessments")
 *                 .ruleSets(AutomationRuleSetArgs.builder()
 *                     .rules(AutomationTriggeringRuleArgs.builder()
 *                         .expectedValue("High")
 *                         .operator("Equals")
 *                         .propertyJPath("properties.metadata.severity")
 *                         .propertyType("String")
 *                         .build())
 *                     .build())
 *                 .build())
 *             .tags()
 *             .build());
 * 
 *     }
 * }
 * 
 * }
 * 
* ### Disable or enable a security automation * *
 * {@code
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.azurenative.security.Automation;
 * import com.pulumi.azurenative.security.AutomationArgs;
 * import com.pulumi.azurenative.security.inputs.AutomationScopeArgs;
 * import com.pulumi.azurenative.security.inputs.AutomationSourceArgs;
 * 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 automation = new Automation("automation", AutomationArgs.builder()
 *             .actions(AutomationActionLogicAppArgs.builder()
 *                 .actionType("LogicApp")
 *                 .logicAppResourceId("/subscriptions/e54a4a18-5b94-4f90-9471-bd3decad8a2e/resourceGroups/sample/providers/Microsoft.Logic/workflows/MyTest1")
 *                 .uri("https://exampleTriggerUri1.com")
 *                 .build())
 *             .automationName("exampleAutomation")
 *             .description("An example of a security automation that triggers one LogicApp resource (myTest1) on any security assessment of type customAssessment")
 *             .isEnabled(false)
 *             .location("Central US")
 *             .resourceGroupName("exampleResourceGroup")
 *             .scopes(AutomationScopeArgs.builder()
 *                 .description("A description that helps to identify this scope - for example: security assessments that relate to the resource group myResourceGroup within the subscription a5caac9c-5c04-49af-b3d0-e204f40345d5")
 *                 .scopePath("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/myResourceGroup")
 *                 .build())
 *             .sources(AutomationSourceArgs.builder()
 *                 .eventSource("Assessments")
 *                 .ruleSets(AutomationRuleSetArgs.builder()
 *                     .rules(AutomationTriggeringRuleArgs.builder()
 *                         .expectedValue("customAssessment")
 *                         .operator("Equals")
 *                         .propertyJPath("$.Entity.AssessmentType")
 *                         .propertyType("String")
 *                         .build())
 *                     .build())
 *                 .build())
 *             .tags()
 *             .build());
 * 
 *     }
 * }
 * 
 * }
 * 
* * ## Import * * An existing resource can be imported using its type token, name, and identifier, e.g. * * ```sh * $ pulumi import azure-native:security:Automation exampleAutomation /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName} * ``` * */ @ResourceType(type="azure-native:security:Automation") public class Automation extends com.pulumi.resources.CustomResource { /** * A collection of the actions which are triggered if all the configured rules evaluations, within at least one rule set, are true. * */ @Export(name="actions", refs={List.class,Object.class}, tree="[0,1]") private Output> actions; /** * @return A collection of the actions which are triggered if all the configured rules evaluations, within at least one rule set, are true. * */ public Output>> actions() { return Codegen.optional(this.actions); } /** * The security automation description. * */ @Export(name="description", refs={String.class}, tree="[0]") private Output description; /** * @return The security automation description. * */ public Output> description() { return Codegen.optional(this.description); } /** * Entity tag is used for comparing two or more entities from the same requested resource. * */ @Export(name="etag", refs={String.class}, tree="[0]") private Output etag; /** * @return Entity tag is used for comparing two or more entities from the same requested resource. * */ public Output> etag() { return Codegen.optional(this.etag); } /** * Indicates whether the security automation is enabled. * */ @Export(name="isEnabled", refs={Boolean.class}, tree="[0]") private Output isEnabled; /** * @return Indicates whether the security automation is enabled. * */ public Output> isEnabled() { return Codegen.optional(this.isEnabled); } /** * Kind of the resource * */ @Export(name="kind", refs={String.class}, tree="[0]") private Output kind; /** * @return Kind of the resource * */ public Output> kind() { return Codegen.optional(this.kind); } /** * Location where the resource is stored * */ @Export(name="location", refs={String.class}, tree="[0]") private Output location; /** * @return Location where the resource is stored * */ public Output> location() { return Codegen.optional(this.location); } /** * Resource name * */ @Export(name="name", refs={String.class}, tree="[0]") private Output name; /** * @return Resource name * */ public Output name() { return this.name; } /** * A collection of scopes on which the security automations logic is applied. Supported scopes are the subscription itself or a resource group under that subscription. The automation will only apply on defined scopes. * */ @Export(name="scopes", refs={List.class,AutomationScopeResponse.class}, tree="[0,1]") private Output> scopes; /** * @return A collection of scopes on which the security automations logic is applied. Supported scopes are the subscription itself or a resource group under that subscription. The automation will only apply on defined scopes. * */ public Output>> scopes() { return Codegen.optional(this.scopes); } /** * A collection of the source event types which evaluate the security automation set of rules. * */ @Export(name="sources", refs={List.class,AutomationSourceResponse.class}, tree="[0,1]") private Output> sources; /** * @return A collection of the source event types which evaluate the security automation set of rules. * */ public Output>> sources() { return Codegen.optional(this.sources); } /** * A list of key value pairs that describe the resource. * */ @Export(name="tags", refs={Map.class,String.class}, tree="[0,1,1]") private Output> tags; /** * @return A list of key value pairs that describe the resource. * */ public Output>> tags() { return Codegen.optional(this.tags); } /** * Resource type * */ @Export(name="type", refs={String.class}, tree="[0]") private Output type; /** * @return Resource type * */ public Output type() { return this.type; } /** * * @param name The _unique_ name of the resulting resource. */ public Automation(java.lang.String name) { this(name, AutomationArgs.Empty); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. */ public Automation(java.lang.String name, AutomationArgs 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 Automation(java.lang.String name, AutomationArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure-native:security:Automation", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false); } private Automation(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure-native:security:Automation", name, null, makeResourceOptions(options, id), false); } private static AutomationArgs makeArgs(AutomationArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { if (options != null && options.getUrn().isPresent()) { return null; } return args == null ? AutomationArgs.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()) .aliases(List.of( Output.of(Alias.builder().type("azure-native:security/v20190101preview:Automation").build()), Output.of(Alias.builder().type("azure-native:security/v20231201preview:Automation").build()) )) .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 options Optional settings to control the behavior of the CustomResource. */ public static Automation get(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) { return new Automation(name, id, options); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy