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

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

There is a newer version: 2.82.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.GovernanceRuleArgs;
import com.pulumi.azurenative.security.outputs.GovernanceRuleEmailNotificationResponse;
import com.pulumi.azurenative.security.outputs.GovernanceRuleMetadataResponse;
import com.pulumi.azurenative.security.outputs.GovernanceRuleOwnerSourceResponse;
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.Integer;
import java.lang.String;
import java.util.List;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * Governance rule over a given scope
 * Azure REST API version: 2022-01-01-preview.
 * 
 * ## Example Usage
 * ### Create or update governance rule over management group scope
 * 
 * 
 * {@code
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.azurenative.security.GovernanceRule;
 * import com.pulumi.azurenative.security.GovernanceRuleArgs;
 * import com.pulumi.azurenative.security.inputs.GovernanceRuleEmailNotificationArgs;
 * import com.pulumi.azurenative.security.inputs.GovernanceRuleOwnerSourceArgs;
 * 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 governanceRule = new GovernanceRule("governanceRule", GovernanceRuleArgs.builder()
 *             .description("A rule for a management group")
 *             .displayName("Management group rule")
 *             .excludedScopes("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23")
 *             .governanceEmailNotification(GovernanceRuleEmailNotificationArgs.builder()
 *                 .disableManagerEmailNotification(true)
 *                 .disableOwnerEmailNotification(false)
 *                 .build())
 *             .isDisabled(false)
 *             .isGracePeriod(true)
 *             .ownerSource(GovernanceRuleOwnerSourceArgs.builder()
 *                 .type("Manually")
 *                 .value("user}{@literal @}{@code contoso.com")
 *                 .build())
 *             .remediationTimeframe("7.00:00:00")
 *             .ruleId("ad9a8e26-29d9-4829-bb30-e597a58cdbb8")
 *             .rulePriority(200)
 *             .ruleType("Integrated")
 *             .scope("providers/Microsoft.Management/managementGroups/contoso")
 *             .sourceResourceType("Assessments")
 *             .build());
 * 
 *     }}{@code
 * }}{@code
 * 
 * }
 * 
* ### Create or update governance rule over security connector scope * *
 * {@code
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.azurenative.security.GovernanceRule;
 * import com.pulumi.azurenative.security.GovernanceRuleArgs;
 * import com.pulumi.azurenative.security.inputs.GovernanceRuleEmailNotificationArgs;
 * import com.pulumi.azurenative.security.inputs.GovernanceRuleOwnerSourceArgs;
 * 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 governanceRule = new GovernanceRule("governanceRule", GovernanceRuleArgs.builder()
 *             .description("A rule on critical GCP recommendations")
 *             .displayName("GCP Admin's rule")
 *             .governanceEmailNotification(GovernanceRuleEmailNotificationArgs.builder()
 *                 .disableManagerEmailNotification(true)
 *                 .disableOwnerEmailNotification(false)
 *                 .build())
 *             .isDisabled(false)
 *             .isGracePeriod(true)
 *             .ownerSource(GovernanceRuleOwnerSourceArgs.builder()
 *                 .type("Manually")
 *                 .value("user}{@literal @}{@code contoso.com")
 *                 .build())
 *             .remediationTimeframe("7.00:00:00")
 *             .ruleId("ad9a8e26-29d9-4829-bb30-e597a58cdbb8")
 *             .rulePriority(200)
 *             .ruleType("Integrated")
 *             .scope("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector")
 *             .sourceResourceType("Assessments")
 *             .build());
 * 
 *     }}{@code
 * }}{@code
 * 
 * }
 * 
* ### Create or update governance rule over subscription scope * *
 * {@code
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.azurenative.security.GovernanceRule;
 * import com.pulumi.azurenative.security.GovernanceRuleArgs;
 * import com.pulumi.azurenative.security.inputs.GovernanceRuleEmailNotificationArgs;
 * import com.pulumi.azurenative.security.inputs.GovernanceRuleOwnerSourceArgs;
 * 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 governanceRule = new GovernanceRule("governanceRule", GovernanceRuleArgs.builder()
 *             .description("A rule for critical recommendations")
 *             .displayName("Admin's rule")
 *             .governanceEmailNotification(GovernanceRuleEmailNotificationArgs.builder()
 *                 .disableManagerEmailNotification(false)
 *                 .disableOwnerEmailNotification(false)
 *                 .build())
 *             .isDisabled(false)
 *             .isGracePeriod(true)
 *             .ownerSource(GovernanceRuleOwnerSourceArgs.builder()
 *                 .type("Manually")
 *                 .value("user}{@literal @}{@code contoso.com")
 *                 .build())
 *             .remediationTimeframe("7.00:00:00")
 *             .ruleId("ad9a8e26-29d9-4829-bb30-e597a58cdbb8")
 *             .rulePriority(200)
 *             .ruleType("Integrated")
 *             .scope("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23")
 *             .sourceResourceType("Assessments")
 *             .build());
 * 
 *     }}{@code
 * }}{@code
 * 
 * }
 * 
* * ## Import * * An existing resource can be imported using its type token, name, and identifier, e.g. * * ```sh * $ pulumi import azure-native:security:GovernanceRule ad9a8e26-29d9-4829-bb30-e597a58cdbb8 /{scope}/providers/Microsoft.Security/governanceRules/{ruleId} * ``` * */ @ResourceType(type="azure-native:security:GovernanceRule") public class GovernanceRule extends com.pulumi.resources.CustomResource { /** * Description of the governance rule * */ @Export(name="description", refs={String.class}, tree="[0]") private Output description; /** * @return Description of the governance rule * */ public Output> description() { return Codegen.optional(this.description); } /** * Display name of the governance rule * */ @Export(name="displayName", refs={String.class}, tree="[0]") private Output displayName; /** * @return Display name of the governance rule * */ public Output displayName() { return this.displayName; } /** * Excluded scopes, filter out the descendants of the scope (on management scopes) * */ @Export(name="excludedScopes", refs={List.class,String.class}, tree="[0,1]") private Output> excludedScopes; /** * @return Excluded scopes, filter out the descendants of the scope (on management scopes) * */ public Output>> excludedScopes() { return Codegen.optional(this.excludedScopes); } /** * The email notifications settings for the governance rule, states whether to disable notifications for mangers and owners * */ @Export(name="governanceEmailNotification", refs={GovernanceRuleEmailNotificationResponse.class}, tree="[0]") private Output governanceEmailNotification; /** * @return The email notifications settings for the governance rule, states whether to disable notifications for mangers and owners * */ public Output> governanceEmailNotification() { return Codegen.optional(this.governanceEmailNotification); } /** * Defines whether the rule is management scope rule (master connector as a single scope or management scope) * */ @Export(name="includeMemberScopes", refs={Boolean.class}, tree="[0]") private Output includeMemberScopes; /** * @return Defines whether the rule is management scope rule (master connector as a single scope or management scope) * */ public Output> includeMemberScopes() { return Codegen.optional(this.includeMemberScopes); } /** * Defines whether the rule is active/inactive * */ @Export(name="isDisabled", refs={Boolean.class}, tree="[0]") private Output isDisabled; /** * @return Defines whether the rule is active/inactive * */ public Output> isDisabled() { return Codegen.optional(this.isDisabled); } /** * Defines whether there is a grace period on the governance rule * */ @Export(name="isGracePeriod", refs={Boolean.class}, tree="[0]") private Output isGracePeriod; /** * @return Defines whether there is a grace period on the governance rule * */ public Output> isGracePeriod() { return Codegen.optional(this.isGracePeriod); } /** * The governance rule metadata * */ @Export(name="metadata", refs={GovernanceRuleMetadataResponse.class}, tree="[0]") private Output metadata; /** * @return The governance rule metadata * */ public Output> metadata() { return Codegen.optional(this.metadata); } /** * Resource name * */ @Export(name="name", refs={String.class}, tree="[0]") private Output name; /** * @return Resource name * */ public Output name() { return this.name; } /** * The owner source for the governance rule - e.g. Manually by user{@literal @}contoso.com - see example * */ @Export(name="ownerSource", refs={GovernanceRuleOwnerSourceResponse.class}, tree="[0]") private Output ownerSource; /** * @return The owner source for the governance rule - e.g. Manually by user{@literal @}contoso.com - see example * */ public Output ownerSource() { return this.ownerSource; } /** * Governance rule remediation timeframe - this is the time that will affect on the grace-period duration e.g. 7.00:00:00 - means 7 days * */ @Export(name="remediationTimeframe", refs={String.class}, tree="[0]") private Output remediationTimeframe; /** * @return Governance rule remediation timeframe - this is the time that will affect on the grace-period duration e.g. 7.00:00:00 - means 7 days * */ public Output> remediationTimeframe() { return Codegen.optional(this.remediationTimeframe); } /** * The governance rule priority, priority to the lower number. Rules with the same priority on the same scope will not be allowed * */ @Export(name="rulePriority", refs={Integer.class}, tree="[0]") private Output rulePriority; /** * @return The governance rule priority, priority to the lower number. Rules with the same priority on the same scope will not be allowed * */ public Output rulePriority() { return this.rulePriority; } /** * The rule type of the governance rule, defines the source of the rule e.g. Integrated * */ @Export(name="ruleType", refs={String.class}, tree="[0]") private Output ruleType; /** * @return The rule type of the governance rule, defines the source of the rule e.g. Integrated * */ public Output ruleType() { return this.ruleType; } /** * The governance rule source, what the rule affects, e.g. Assessments * */ @Export(name="sourceResourceType", refs={String.class}, tree="[0]") private Output sourceResourceType; /** * @return The governance rule source, what the rule affects, e.g. Assessments * */ public Output sourceResourceType() { return this.sourceResourceType; } /** * The tenantId (GUID) * */ @Export(name="tenantId", refs={String.class}, tree="[0]") private Output tenantId; /** * @return The tenantId (GUID) * */ public Output tenantId() { return this.tenantId; } /** * 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 GovernanceRule(java.lang.String name) { this(name, GovernanceRuleArgs.Empty); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. */ public GovernanceRule(java.lang.String name, GovernanceRuleArgs 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 GovernanceRule(java.lang.String name, GovernanceRuleArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure-native:security:GovernanceRule", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false); } private GovernanceRule(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure-native:security:GovernanceRule", name, null, makeResourceOptions(options, id), false); } private static GovernanceRuleArgs makeArgs(GovernanceRuleArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { if (options != null && options.getUrn().isPresent()) { return null; } return args == null ? GovernanceRuleArgs.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/v20220101preview:GovernanceRule").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 GovernanceRule get(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) { return new GovernanceRule(name, id, options); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy