Google Cloud v8.22.0 published on Thursday, Mar 13, 2025 by Pulumi
gcp.apigateway.getApiIamPolicy
Explore with Pulumi AI
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const policy = gcp.apigateway.getApiIamPolicy({
project: api.project,
api: api.apiId,
});
import pulumi
import pulumi_gcp as gcp
policy = gcp.apigateway.get_api_iam_policy(project=api["project"],
api=api["apiId"])
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/apigateway"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := apigateway.LookupApiIamPolicy(ctx, &apigateway.LookupApiIamPolicyArgs{
Project: pulumi.StringRef(api.Project),
Api: api.ApiId,
}, 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 = Gcp.ApiGateway.GetApiIamPolicy.Invoke(new()
{
Project = api.Project,
Api = api.ApiId,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.apigateway.ApigatewayFunctions;
import com.pulumi.gcp.apigateway.inputs.GetApiIamPolicyArgs;
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 = ApigatewayFunctions.getApiIamPolicy(GetApiIamPolicyArgs.builder()
.project(api.project())
.api(api.apiId())
.build());
}
}
variables:
policy:
fn::invoke:
function: gcp:apigateway:getApiIamPolicy
arguments:
project: ${api.project}
api: ${api.apiId}
Using getApiIamPolicy
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 getApiIamPolicy(args: GetApiIamPolicyArgs, opts?: InvokeOptions): Promise<GetApiIamPolicyResult>
function getApiIamPolicyOutput(args: GetApiIamPolicyOutputArgs, opts?: InvokeOptions): Output<GetApiIamPolicyResult>
def get_api_iam_policy(api: Optional[str] = None,
project: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetApiIamPolicyResult
def get_api_iam_policy_output(api: Optional[pulumi.Input[str]] = None,
project: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetApiIamPolicyResult]
func LookupApiIamPolicy(ctx *Context, args *LookupApiIamPolicyArgs, opts ...InvokeOption) (*LookupApiIamPolicyResult, error)
func LookupApiIamPolicyOutput(ctx *Context, args *LookupApiIamPolicyOutputArgs, opts ...InvokeOption) LookupApiIamPolicyResultOutput
> Note: This function is named LookupApiIamPolicy
in the Go SDK.
public static class GetApiIamPolicy
{
public static Task<GetApiIamPolicyResult> InvokeAsync(GetApiIamPolicyArgs args, InvokeOptions? opts = null)
public static Output<GetApiIamPolicyResult> Invoke(GetApiIamPolicyInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetApiIamPolicyResult> getApiIamPolicy(GetApiIamPolicyArgs args, InvokeOptions options)
public static Output<GetApiIamPolicyResult> getApiIamPolicy(GetApiIamPolicyArgs args, InvokeOptions options)
fn::invoke:
function: gcp:apigateway/getApiIamPolicy:getApiIamPolicy
arguments:
# arguments dictionary
The following arguments are supported:
getApiIamPolicy Result
The following output properties are available:
- Api string
- Etag string
- (Computed) The etag of the IAM policy.
- Id string
- The provider-assigned unique ID for this managed resource.
- Policy
Data string - (Required only by
gcp.apigateway.ApiIamPolicy
) The policy data generated by agcp.organizations.getIAMPolicy
data source. - Project string
- Api string
- Etag string
- (Computed) The etag of the IAM policy.
- Id string
- The provider-assigned unique ID for this managed resource.
- Policy
Data string - (Required only by
gcp.apigateway.ApiIamPolicy
) The policy data generated by agcp.organizations.getIAMPolicy
data source. - Project string
- api String
- etag String
- (Computed) The etag of the IAM policy.
- id String
- The provider-assigned unique ID for this managed resource.
- policy
Data String - (Required only by
gcp.apigateway.ApiIamPolicy
) The policy data generated by agcp.organizations.getIAMPolicy
data source. - project String
- api string
- etag string
- (Computed) The etag of the IAM policy.
- id string
- The provider-assigned unique ID for this managed resource.
- policy
Data string - (Required only by
gcp.apigateway.ApiIamPolicy
) The policy data generated by agcp.organizations.getIAMPolicy
data source. - project string
- api str
- etag str
- (Computed) The etag of the IAM policy.
- id str
- The provider-assigned unique ID for this managed resource.
- policy_
data str - (Required only by
gcp.apigateway.ApiIamPolicy
) The policy data generated by agcp.organizations.getIAMPolicy
data source. - project str
- api String
- etag String
- (Computed) The etag of the IAM policy.
- id String
- The provider-assigned unique ID for this managed resource.
- policy
Data String - (Required only by
gcp.apigateway.ApiIamPolicy
) The policy data generated by agcp.organizations.getIAMPolicy
data source. - project String
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.