Google Cloud Classic v7.29.0 published on Wednesday, Jun 26, 2024 by Pulumi
gcp.secretmanager.getSecretIamPolicy
Explore with Pulumi AI
Retrieves the current IAM policy data for secret
example
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const policy = gcp.secretmanager.getSecretIamPolicy({
project: secret_basic.project,
secretId: secret_basic.secretId,
});
import pulumi
import pulumi_gcp as gcp
policy = gcp.secretmanager.get_secret_iam_policy(project=secret_basic["project"],
secret_id=secret_basic["secretId"])
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/secretmanager"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := secretmanager.LookupSecretIamPolicy(ctx, &secretmanager.LookupSecretIamPolicyArgs{
Project: pulumi.StringRef(secret_basic.Project),
SecretId: secret_basic.SecretId,
}, 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.SecretManager.GetSecretIamPolicy.Invoke(new()
{
Project = secret_basic.Project,
SecretId = secret_basic.SecretId,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.secretmanager.SecretmanagerFunctions;
import com.pulumi.gcp.secretmanager.inputs.GetSecretIamPolicyArgs;
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 = SecretmanagerFunctions.getSecretIamPolicy(GetSecretIamPolicyArgs.builder()
.project(secret_basic.project())
.secretId(secret_basic.secretId())
.build());
}
}
variables:
policy:
fn::invoke:
Function: gcp:secretmanager:getSecretIamPolicy
Arguments:
project: ${["secret-basic"].project}
secretId: ${["secret-basic"].secretId}
Using getSecretIamPolicy
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 getSecretIamPolicy(args: GetSecretIamPolicyArgs, opts?: InvokeOptions): Promise<GetSecretIamPolicyResult>
function getSecretIamPolicyOutput(args: GetSecretIamPolicyOutputArgs, opts?: InvokeOptions): Output<GetSecretIamPolicyResult>
def get_secret_iam_policy(project: Optional[str] = None,
secret_id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetSecretIamPolicyResult
def get_secret_iam_policy_output(project: Optional[pulumi.Input[str]] = None,
secret_id: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetSecretIamPolicyResult]
func LookupSecretIamPolicy(ctx *Context, args *LookupSecretIamPolicyArgs, opts ...InvokeOption) (*LookupSecretIamPolicyResult, error)
func LookupSecretIamPolicyOutput(ctx *Context, args *LookupSecretIamPolicyOutputArgs, opts ...InvokeOption) LookupSecretIamPolicyResultOutput
> Note: This function is named LookupSecretIamPolicy
in the Go SDK.
public static class GetSecretIamPolicy
{
public static Task<GetSecretIamPolicyResult> InvokeAsync(GetSecretIamPolicyArgs args, InvokeOptions? opts = null)
public static Output<GetSecretIamPolicyResult> Invoke(GetSecretIamPolicyInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetSecretIamPolicyResult> getSecretIamPolicy(GetSecretIamPolicyArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: gcp:secretmanager/getSecretIamPolicy:getSecretIamPolicy
arguments:
# arguments dictionary
The following arguments are supported:
getSecretIamPolicy Result
The following output properties are available:
- 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.secretmanager.SecretIamPolicy
) The policy data generated by agcp.organizations.getIAMPolicy
data source. - Project string
- Secret
Id 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.secretmanager.SecretIamPolicy
) The policy data generated by agcp.organizations.getIAMPolicy
data source. - Project string
- Secret
Id 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.secretmanager.SecretIamPolicy
) The policy data generated by agcp.organizations.getIAMPolicy
data source. - project String
- secret
Id 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.secretmanager.SecretIamPolicy
) The policy data generated by agcp.organizations.getIAMPolicy
data source. - project string
- secret
Id string
- 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.secretmanager.SecretIamPolicy
) The policy data generated by agcp.organizations.getIAMPolicy
data source. - project str
- secret_
id str
- 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.secretmanager.SecretIamPolicy
) The policy data generated by agcp.organizations.getIAMPolicy
data source. - project String
- secret
Id 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.