1. Packages
  2. AWS
  3. API Docs
  4. vpclattice
  5. getResourcePolicy
AWS v6.64.0 published on Friday, Dec 6, 2024 by Pulumi

aws.vpclattice.getResourcePolicy

Explore with Pulumi AI

aws logo
AWS v6.64.0 published on Friday, Dec 6, 2024 by Pulumi

    Data source for managing an AWS VPC Lattice Resource Policy.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = aws.vpclattice.getResourcePolicy({
        resourceArn: exampleAwsVpclatticeServiceNetwork.arn,
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.vpclattice.get_resource_policy(resource_arn=example_aws_vpclattice_service_network["arn"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/vpclattice"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := vpclattice.LookupResourcePolicy(ctx, &vpclattice.LookupResourcePolicyArgs{
    			ResourceArn: exampleAwsVpclatticeServiceNetwork.Arn,
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Aws.VpcLattice.GetResourcePolicy.Invoke(new()
        {
            ResourceArn = exampleAwsVpclatticeServiceNetwork.Arn,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.vpclattice.VpclatticeFunctions;
    import com.pulumi.aws.vpclattice.inputs.GetResourcePolicyArgs;
    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) {
            final var example = VpclatticeFunctions.getResourcePolicy(GetResourcePolicyArgs.builder()
                .resourceArn(exampleAwsVpclatticeServiceNetwork.arn())
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: aws:vpclattice:getResourcePolicy
          Arguments:
            resourceArn: ${exampleAwsVpclatticeServiceNetwork.arn}
    

    Using getResourcePolicy

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getResourcePolicy(args: GetResourcePolicyArgs, opts?: InvokeOptions): Promise<GetResourcePolicyResult>
    function getResourcePolicyOutput(args: GetResourcePolicyOutputArgs, opts?: InvokeOptions): Output<GetResourcePolicyResult>
    def get_resource_policy(resource_arn: Optional[str] = None,
                            opts: Optional[InvokeOptions] = None) -> GetResourcePolicyResult
    def get_resource_policy_output(resource_arn: Optional[pulumi.Input[str]] = None,
                            opts: Optional[InvokeOptions] = None) -> Output[GetResourcePolicyResult]
    func LookupResourcePolicy(ctx *Context, args *LookupResourcePolicyArgs, opts ...InvokeOption) (*LookupResourcePolicyResult, error)
    func LookupResourcePolicyOutput(ctx *Context, args *LookupResourcePolicyOutputArgs, opts ...InvokeOption) LookupResourcePolicyResultOutput

    > Note: This function is named LookupResourcePolicy in the Go SDK.

    public static class GetResourcePolicy 
    {
        public static Task<GetResourcePolicyResult> InvokeAsync(GetResourcePolicyArgs args, InvokeOptions? opts = null)
        public static Output<GetResourcePolicyResult> Invoke(GetResourcePolicyInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetResourcePolicyResult> getResourcePolicy(GetResourcePolicyArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: aws:vpclattice/getResourcePolicy:getResourcePolicy
      arguments:
        # arguments dictionary

    The following arguments are supported:

    ResourceArn string
    Resource ARN of the resource for which a policy is retrieved.
    ResourceArn string
    Resource ARN of the resource for which a policy is retrieved.
    resourceArn String
    Resource ARN of the resource for which a policy is retrieved.
    resourceArn string
    Resource ARN of the resource for which a policy is retrieved.
    resource_arn str
    Resource ARN of the resource for which a policy is retrieved.
    resourceArn String
    Resource ARN of the resource for which a policy is retrieved.

    getResourcePolicy Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Policy string
    JSON-encoded string representation of the applied resource policy.
    ResourceArn string
    Id string
    The provider-assigned unique ID for this managed resource.
    Policy string
    JSON-encoded string representation of the applied resource policy.
    ResourceArn string
    id String
    The provider-assigned unique ID for this managed resource.
    policy String
    JSON-encoded string representation of the applied resource policy.
    resourceArn String
    id string
    The provider-assigned unique ID for this managed resource.
    policy string
    JSON-encoded string representation of the applied resource policy.
    resourceArn string
    id str
    The provider-assigned unique ID for this managed resource.
    policy str
    JSON-encoded string representation of the applied resource policy.
    resource_arn str
    id String
    The provider-assigned unique ID for this managed resource.
    policy String
    JSON-encoded string representation of the applied resource policy.
    resourceArn String

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo
    AWS v6.64.0 published on Friday, Dec 6, 2024 by Pulumi