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

com.pulumi.aws.vpclattice.AuthPolicy Maven / Gradle / Ivy

Go to download

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

There is a newer version: 6.72.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.aws.vpclattice;

import com.pulumi.aws.Utilities;
import com.pulumi.aws.vpclattice.AuthPolicyArgs;
import com.pulumi.aws.vpclattice.inputs.AuthPolicyState;
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 java.util.Optional;
import javax.annotation.Nullable;

/**
 * Resource for managing an AWS VPC Lattice Auth Policy.
 * 
 * ## Example Usage
 * 
 * ### Basic Usage
 * 
 * <!--Start PulumiCodeChooser -->
 * 
 * {@code
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.aws.vpclattice.Service;
 * import com.pulumi.aws.vpclattice.ServiceArgs;
 * import com.pulumi.aws.vpclattice.AuthPolicy;
 * import com.pulumi.aws.vpclattice.AuthPolicyArgs;
 * import static com.pulumi.codegen.internal.Serialization.*;
 * 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 Service("example", ServiceArgs.builder()
 *             .name("example-vpclattice-service")
 *             .authType("AWS_IAM")
 *             .customDomainName("example.com")
 *             .build());
 * 
 *         var exampleAuthPolicy = new AuthPolicy("exampleAuthPolicy", AuthPolicyArgs.builder()
 *             .resourceIdentifier(example.arn())
 *             .policy(serializeJson(
 *                 jsonObject(
 *                     jsonProperty("Version", "2012-10-17"),
 *                     jsonProperty("Statement", jsonArray(jsonObject(
 *                         jsonProperty("Action", "*"),
 *                         jsonProperty("Effect", "Allow"),
 *                         jsonProperty("Principal", "*"),
 *                         jsonProperty("Resource", "*"),
 *                         jsonProperty("Condition", jsonObject(
 *                             jsonProperty("StringNotEqualsIgnoreCase", jsonObject(
 *                                 jsonProperty("aws:PrincipalType", "anonymous")
 *                             ))
 *                         ))
 *                     )))
 *                 )))
 *             .build());
 * 
 *     }
 * }
 * }
 * 
* <!--End PulumiCodeChooser --> * * ## Import * * Using `pulumi import`, import VPC Lattice Auth Policy using the `id`. For example: * * ```sh * $ pulumi import aws:vpclattice/authPolicy:AuthPolicy example abcd-12345678 * ``` * */ @ResourceType(type="aws:vpclattice/authPolicy:AuthPolicy") public class AuthPolicy extends com.pulumi.resources.CustomResource { /** * The auth policy. The policy string in JSON must not contain newlines or blank lines. * */ @Export(name="policy", refs={String.class}, tree="[0]") private Output policy; /** * @return The auth policy. The policy string in JSON must not contain newlines or blank lines. * */ public Output policy() { return this.policy; } /** * The ID or Amazon Resource Name (ARN) of the service network or service for which the policy is created. * */ @Export(name="resourceIdentifier", refs={String.class}, tree="[0]") private Output resourceIdentifier; /** * @return The ID or Amazon Resource Name (ARN) of the service network or service for which the policy is created. * */ public Output resourceIdentifier() { return this.resourceIdentifier; } /** * The state of the auth policy. The auth policy is only active when the auth type is set to `AWS_IAM`. If you provide a policy, then authentication and authorization decisions are made based on this policy and the client's IAM policy. If the Auth type is `NONE`, then, any auth policy you provide will remain inactive. * */ @Export(name="state", refs={String.class}, tree="[0]") private Output state; /** * @return The state of the auth policy. The auth policy is only active when the auth type is set to `AWS_IAM`. If you provide a policy, then authentication and authorization decisions are made based on this policy and the client's IAM policy. If the Auth type is `NONE`, then, any auth policy you provide will remain inactive. * */ public Output> state() { return Codegen.optional(this.state); } /** * * @param name The _unique_ name of the resulting resource. */ public AuthPolicy(java.lang.String name) { this(name, AuthPolicyArgs.Empty); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. */ public AuthPolicy(java.lang.String name, AuthPolicyArgs 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 AuthPolicy(java.lang.String name, AuthPolicyArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("aws:vpclattice/authPolicy:AuthPolicy", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false); } private AuthPolicy(java.lang.String name, Output id, @Nullable AuthPolicyState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("aws:vpclattice/authPolicy:AuthPolicy", name, state, makeResourceOptions(options, id), false); } private static AuthPolicyArgs makeArgs(AuthPolicyArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { if (options != null && options.getUrn().isPresent()) { return null; } return args == null ? AuthPolicyArgs.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 AuthPolicy get(java.lang.String name, Output id, @Nullable AuthPolicyState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { return new AuthPolicy(name, id, state, options); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy