Google Cloud Classic v8.10.0 published on Wednesday, Nov 20, 2024 by Pulumi
gcp.accesscontextmanager.getAccessPolicy
Explore with Pulumi AI
Get information about an Access Context Manager AccessPolicy.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const policy-org = gcp.accesscontextmanager.getAccessPolicy({
parent: "organizations/1234567",
});
const policy-scoped = gcp.accesscontextmanager.getAccessPolicy({
parent: "organizations/1234567",
scopes: ["projects/1234567"],
});
import pulumi
import pulumi_gcp as gcp
policy_org = gcp.accesscontextmanager.get_access_policy(parent="organizations/1234567")
policy_scoped = gcp.accesscontextmanager.get_access_policy(parent="organizations/1234567",
scopes=["projects/1234567"])
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/accesscontextmanager"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := accesscontextmanager.LookupAccessPolicy(ctx, &accesscontextmanager.LookupAccessPolicyArgs{
Parent: "organizations/1234567",
}, nil)
if err != nil {
return err
}
_, err = accesscontextmanager.LookupAccessPolicy(ctx, &accesscontextmanager.LookupAccessPolicyArgs{
Parent: "organizations/1234567",
Scopes: []string{
"projects/1234567",
},
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var policy_org = Gcp.AccessContextManager.GetAccessPolicy.Invoke(new()
{
Parent = "organizations/1234567",
});
var policy_scoped = Gcp.AccessContextManager.GetAccessPolicy.Invoke(new()
{
Parent = "organizations/1234567",
Scopes = new[]
{
"projects/1234567",
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.accesscontextmanager.AccesscontextmanagerFunctions;
import com.pulumi.gcp.accesscontextmanager.inputs.GetAccessPolicyArgs;
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 policy-org = AccesscontextmanagerFunctions.getAccessPolicy(GetAccessPolicyArgs.builder()
.parent("organizations/1234567")
.build());
final var policy-scoped = AccesscontextmanagerFunctions.getAccessPolicy(GetAccessPolicyArgs.builder()
.parent("organizations/1234567")
.scopes("projects/1234567")
.build());
}
}
variables:
policy-org:
fn::invoke:
Function: gcp:accesscontextmanager:getAccessPolicy
Arguments:
parent: organizations/1234567
policy-scoped:
fn::invoke:
Function: gcp:accesscontextmanager:getAccessPolicy
Arguments:
parent: organizations/1234567
scopes:
- projects/1234567
Using getAccessPolicy
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 getAccessPolicy(args: GetAccessPolicyArgs, opts?: InvokeOptions): Promise<GetAccessPolicyResult>
function getAccessPolicyOutput(args: GetAccessPolicyOutputArgs, opts?: InvokeOptions): Output<GetAccessPolicyResult>
def get_access_policy(parent: Optional[str] = None,
scopes: Optional[Sequence[str]] = None,
opts: Optional[InvokeOptions] = None) -> GetAccessPolicyResult
def get_access_policy_output(parent: Optional[pulumi.Input[str]] = None,
scopes: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetAccessPolicyResult]
func LookupAccessPolicy(ctx *Context, args *LookupAccessPolicyArgs, opts ...InvokeOption) (*LookupAccessPolicyResult, error)
func LookupAccessPolicyOutput(ctx *Context, args *LookupAccessPolicyOutputArgs, opts ...InvokeOption) LookupAccessPolicyResultOutput
> Note: This function is named LookupAccessPolicy
in the Go SDK.
public static class GetAccessPolicy
{
public static Task<GetAccessPolicyResult> InvokeAsync(GetAccessPolicyArgs args, InvokeOptions? opts = null)
public static Output<GetAccessPolicyResult> Invoke(GetAccessPolicyInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetAccessPolicyResult> getAccessPolicy(GetAccessPolicyArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: gcp:accesscontextmanager/getAccessPolicy:getAccessPolicy
arguments:
# arguments dictionary
The following arguments are supported:
getAccessPolicy Result
The following output properties are available:
Package Details
- Repository
- Google Cloud (GCP) Classic pulumi/pulumi-gcp
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
google-beta
Terraform Provider.