github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/vpclattice/getAuthPolicy.go (about)

     1  // Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
     2  // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
     3  
     4  package vpclattice
     5  
     6  import (
     7  	"context"
     8  	"reflect"
     9  
    10  	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal"
    11  	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    12  )
    13  
    14  // Data source for managing an AWS VPC Lattice Auth Policy.
    15  //
    16  // ## Example Usage
    17  //
    18  // ### Basic Usage
    19  //
    20  // <!--Start PulumiCodeChooser -->
    21  // ```go
    22  // package main
    23  //
    24  // import (
    25  //
    26  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/vpclattice"
    27  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    28  //
    29  // )
    30  //
    31  //	func main() {
    32  //		pulumi.Run(func(ctx *pulumi.Context) error {
    33  //			_, err := vpclattice.LookupAuthPolicy(ctx, &vpclattice.LookupAuthPolicyArgs{
    34  //				ResourceIdentifier: testAwsVpclatticeAuthPolicy.ResourceIdentifier,
    35  //			}, nil)
    36  //			if err != nil {
    37  //				return err
    38  //			}
    39  //			return nil
    40  //		})
    41  //	}
    42  //
    43  // ```
    44  // <!--End PulumiCodeChooser -->
    45  func LookupAuthPolicy(ctx *pulumi.Context, args *LookupAuthPolicyArgs, opts ...pulumi.InvokeOption) (*LookupAuthPolicyResult, error) {
    46  	opts = internal.PkgInvokeDefaultOpts(opts)
    47  	var rv LookupAuthPolicyResult
    48  	err := ctx.Invoke("aws:vpclattice/getAuthPolicy:getAuthPolicy", args, &rv, opts...)
    49  	if err != nil {
    50  		return nil, err
    51  	}
    52  	return &rv, nil
    53  }
    54  
    55  // A collection of arguments for invoking getAuthPolicy.
    56  type LookupAuthPolicyArgs struct {
    57  	// The auth policy. The policy string in JSON must not contain newlines or blank lines.
    58  	Policy *string `pulumi:"policy"`
    59  	// The ID or Amazon Resource Name (ARN) of the service network or service for which the policy is created.
    60  	ResourceIdentifier string `pulumi:"resourceIdentifier"`
    61  	// 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.
    62  	State *string `pulumi:"state"`
    63  }
    64  
    65  // A collection of values returned by getAuthPolicy.
    66  type LookupAuthPolicyResult struct {
    67  	// The provider-assigned unique ID for this managed resource.
    68  	Id string `pulumi:"id"`
    69  	// The auth policy. The policy string in JSON must not contain newlines or blank lines.
    70  	Policy             *string `pulumi:"policy"`
    71  	ResourceIdentifier string  `pulumi:"resourceIdentifier"`
    72  	// 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.
    73  	State *string `pulumi:"state"`
    74  }
    75  
    76  func LookupAuthPolicyOutput(ctx *pulumi.Context, args LookupAuthPolicyOutputArgs, opts ...pulumi.InvokeOption) LookupAuthPolicyResultOutput {
    77  	return pulumi.ToOutputWithContext(context.Background(), args).
    78  		ApplyT(func(v interface{}) (LookupAuthPolicyResult, error) {
    79  			args := v.(LookupAuthPolicyArgs)
    80  			r, err := LookupAuthPolicy(ctx, &args, opts...)
    81  			var s LookupAuthPolicyResult
    82  			if r != nil {
    83  				s = *r
    84  			}
    85  			return s, err
    86  		}).(LookupAuthPolicyResultOutput)
    87  }
    88  
    89  // A collection of arguments for invoking getAuthPolicy.
    90  type LookupAuthPolicyOutputArgs struct {
    91  	// The auth policy. The policy string in JSON must not contain newlines or blank lines.
    92  	Policy pulumi.StringPtrInput `pulumi:"policy"`
    93  	// The ID or Amazon Resource Name (ARN) of the service network or service for which the policy is created.
    94  	ResourceIdentifier pulumi.StringInput `pulumi:"resourceIdentifier"`
    95  	// 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.
    96  	State pulumi.StringPtrInput `pulumi:"state"`
    97  }
    98  
    99  func (LookupAuthPolicyOutputArgs) ElementType() reflect.Type {
   100  	return reflect.TypeOf((*LookupAuthPolicyArgs)(nil)).Elem()
   101  }
   102  
   103  // A collection of values returned by getAuthPolicy.
   104  type LookupAuthPolicyResultOutput struct{ *pulumi.OutputState }
   105  
   106  func (LookupAuthPolicyResultOutput) ElementType() reflect.Type {
   107  	return reflect.TypeOf((*LookupAuthPolicyResult)(nil)).Elem()
   108  }
   109  
   110  func (o LookupAuthPolicyResultOutput) ToLookupAuthPolicyResultOutput() LookupAuthPolicyResultOutput {
   111  	return o
   112  }
   113  
   114  func (o LookupAuthPolicyResultOutput) ToLookupAuthPolicyResultOutputWithContext(ctx context.Context) LookupAuthPolicyResultOutput {
   115  	return o
   116  }
   117  
   118  // The provider-assigned unique ID for this managed resource.
   119  func (o LookupAuthPolicyResultOutput) Id() pulumi.StringOutput {
   120  	return o.ApplyT(func(v LookupAuthPolicyResult) string { return v.Id }).(pulumi.StringOutput)
   121  }
   122  
   123  // The auth policy. The policy string in JSON must not contain newlines or blank lines.
   124  func (o LookupAuthPolicyResultOutput) Policy() pulumi.StringPtrOutput {
   125  	return o.ApplyT(func(v LookupAuthPolicyResult) *string { return v.Policy }).(pulumi.StringPtrOutput)
   126  }
   127  
   128  func (o LookupAuthPolicyResultOutput) ResourceIdentifier() pulumi.StringOutput {
   129  	return o.ApplyT(func(v LookupAuthPolicyResult) string { return v.ResourceIdentifier }).(pulumi.StringOutput)
   130  }
   131  
   132  // 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.
   133  func (o LookupAuthPolicyResultOutput) State() pulumi.StringPtrOutput {
   134  	return o.ApplyT(func(v LookupAuthPolicyResult) *string { return v.State }).(pulumi.StringPtrOutput)
   135  }
   136  
   137  func init() {
   138  	pulumi.RegisterOutputType(LookupAuthPolicyResultOutput{})
   139  }