yandex.ContainerRepositoryIamBinding
Explore with Pulumi AI
yandex_container_repository_iam_binding
Allows creation and management of a single binding within IAM policy for an existing Yandex Container Repository.
Example Usage
using Pulumi;
using Yandex = Pulumi.Yandex;
class MyStack : Stack
{
public MyStack()
{
var your_registry = new Yandex.ContainerRegistry("your-registry", new Yandex.ContainerRegistryArgs
{
FolderId = "your-folder-id",
});
var repo_1 = new Yandex.ContainerRepository("repo-1", new Yandex.ContainerRepositoryArgs
{
});
var puller = new Yandex.ContainerRepositoryIamBinding("puller", new Yandex.ContainerRepositoryIamBindingArgs
{
RepositoryId = repo_1.Id,
Role = "container-registry.images.puller",
Members =
{
"system:allUsers",
},
});
var repo_2 = Output.Create(Yandex.GetContainerRepository.InvokeAsync(new Yandex.GetContainerRepositoryArgs
{
Name = "some_repository_name",
}));
var pusher = new Yandex.ContainerRepositoryIamBinding("pusher", new Yandex.ContainerRepositoryIamBindingArgs
{
RepositoryId = repo_2.Apply(repo_2 => repo_2.Id),
Role = "container-registry.images.pusher",
Members =
{
"serviceAccount:your-service-account-id",
},
});
}
}
package main
import (
"github.com/pulumi/pulumi-yandex/sdk/go/yandex"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := yandex.NewContainerRegistry(ctx, "your-registry", &yandex.ContainerRegistryArgs{
FolderId: pulumi.String("your-folder-id"),
})
if err != nil {
return err
}
_, err = yandex.NewContainerRepository(ctx, "repo-1", nil)
if err != nil {
return err
}
_, err = yandex.NewContainerRepositoryIamBinding(ctx, "puller", &yandex.ContainerRepositoryIamBindingArgs{
RepositoryId: repo_1.ID(),
Role: pulumi.String("container-registry.images.puller"),
Members: pulumi.StringArray{
pulumi.String("system:allUsers"),
},
})
if err != nil {
return err
}
opt0 := "some_repository_name"
repo_2, err := yandex.LookupContainerRepository(ctx, &GetContainerRepositoryArgs{
Name: &opt0,
}, nil)
if err != nil {
return err
}
_, err = yandex.NewContainerRepositoryIamBinding(ctx, "pusher", &yandex.ContainerRepositoryIamBindingArgs{
RepositoryId: pulumi.String(repo_2.Id),
Role: pulumi.String("container-registry.images.pusher"),
Members: pulumi.StringArray{
pulumi.String("serviceAccount:your-service-account-id"),
},
})
if err != nil {
return err
}
return nil
})
}
Coming soon!
import pulumi
import pulumi_yandex as yandex
your_registry = yandex.ContainerRegistry("your-registry", folder_id="your-folder-id")
repo_1 = yandex.ContainerRepository("repo-1")
puller = yandex.ContainerRepositoryIamBinding("puller",
repository_id=repo_1.id,
role="container-registry.images.puller",
members=["system:allUsers"])
repo_2 = yandex.get_container_repository(name="some_repository_name")
pusher = yandex.ContainerRepositoryIamBinding("pusher",
repository_id=repo_2.id,
role="container-registry.images.pusher",
members=["serviceAccount:your-service-account-id"])
import * as pulumi from "@pulumi/pulumi";
import * as yandex from "@pulumi/yandex";
const your_registry = new yandex.ContainerRegistry("your-registry", {folderId: "your-folder-id"});
const repo_1 = new yandex.ContainerRepository("repo-1", {});
const puller = new yandex.ContainerRepositoryIamBinding("puller", {
repositoryId: repo_1.id,
role: "container-registry.images.puller",
members: ["system:allUsers"],
});
const repo-2 = yandex.getContainerRepository({
name: "some_repository_name",
});
const pusher = new yandex.ContainerRepositoryIamBinding("pusher", {
repositoryId: repo_2.then(repo_2 => repo_2.id),
role: "container-registry.images.pusher",
members: ["serviceAccount:your-service-account-id"],
});
Coming soon!
Create ContainerRepositoryIamBinding Resource
new ContainerRepositoryIamBinding(name: string, args: ContainerRepositoryIamBindingArgs, opts?: CustomResourceOptions);
@overload
def ContainerRepositoryIamBinding(resource_name: str,
opts: Optional[ResourceOptions] = None,
members: Optional[Sequence[str]] = None,
repository_id: Optional[str] = None,
role: Optional[str] = None,
sleep_after: Optional[int] = None)
@overload
def ContainerRepositoryIamBinding(resource_name: str,
args: ContainerRepositoryIamBindingArgs,
opts: Optional[ResourceOptions] = None)
func NewContainerRepositoryIamBinding(ctx *Context, name string, args ContainerRepositoryIamBindingArgs, opts ...ResourceOption) (*ContainerRepositoryIamBinding, error)
public ContainerRepositoryIamBinding(string name, ContainerRepositoryIamBindingArgs args, CustomResourceOptions? opts = null)
public ContainerRepositoryIamBinding(String name, ContainerRepositoryIamBindingArgs args)
public ContainerRepositoryIamBinding(String name, ContainerRepositoryIamBindingArgs args, CustomResourceOptions options)
type: yandex:ContainerRepositoryIamBinding
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ContainerRepositoryIamBindingArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args ContainerRepositoryIamBindingArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args ContainerRepositoryIamBindingArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ContainerRepositoryIamBindingArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ContainerRepositoryIamBindingArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
ContainerRepositoryIamBinding Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The ContainerRepositoryIamBinding resource accepts the following input properties:
- Members List<string>
Identities that will be granted the privilege in
role
. Each entry can have one of the following values:- userAccount:{user_id}: A unique user ID that represents a specific Yandex account.
- serviceAccount:{service_account_id}: A unique service account ID.
- system:{allUsers|allAuthenticatedUsers}: see system groups
- Repository
Id string The Yandex Container Repository ID to apply a binding to.
- Role string
The role that should be applied. See roles.
- Sleep
After int
- Members []string
Identities that will be granted the privilege in
role
. Each entry can have one of the following values:- userAccount:{user_id}: A unique user ID that represents a specific Yandex account.
- serviceAccount:{service_account_id}: A unique service account ID.
- system:{allUsers|allAuthenticatedUsers}: see system groups
- Repository
Id string The Yandex Container Repository ID to apply a binding to.
- Role string
The role that should be applied. See roles.
- Sleep
After int
- members List<String>
Identities that will be granted the privilege in
role
. Each entry can have one of the following values:- userAccount:{user_id}: A unique user ID that represents a specific Yandex account.
- serviceAccount:{service_account_id}: A unique service account ID.
- system:{allUsers|allAuthenticatedUsers}: see system groups
- repository
Id String The Yandex Container Repository ID to apply a binding to.
- role String
The role that should be applied. See roles.
- sleep
After Integer
- members string[]
Identities that will be granted the privilege in
role
. Each entry can have one of the following values:- userAccount:{user_id}: A unique user ID that represents a specific Yandex account.
- serviceAccount:{service_account_id}: A unique service account ID.
- system:{allUsers|allAuthenticatedUsers}: see system groups
- repository
Id string The Yandex Container Repository ID to apply a binding to.
- role string
The role that should be applied. See roles.
- sleep
After number
- members Sequence[str]
Identities that will be granted the privilege in
role
. Each entry can have one of the following values:- userAccount:{user_id}: A unique user ID that represents a specific Yandex account.
- serviceAccount:{service_account_id}: A unique service account ID.
- system:{allUsers|allAuthenticatedUsers}: see system groups
- repository_
id str The Yandex Container Repository ID to apply a binding to.
- role str
The role that should be applied. See roles.
- sleep_
after int
- members List<String>
Identities that will be granted the privilege in
role
. Each entry can have one of the following values:- userAccount:{user_id}: A unique user ID that represents a specific Yandex account.
- serviceAccount:{service_account_id}: A unique service account ID.
- system:{allUsers|allAuthenticatedUsers}: see system groups
- repository
Id String The Yandex Container Repository ID to apply a binding to.
- role String
The role that should be applied. See roles.
- sleep
After Number
Outputs
All input properties are implicitly available as output properties. Additionally, the ContainerRepositoryIamBinding resource produces the following output properties:
- Id string
The provider-assigned unique ID for this managed resource.
- Id string
The provider-assigned unique ID for this managed resource.
- id String
The provider-assigned unique ID for this managed resource.
- id string
The provider-assigned unique ID for this managed resource.
- id str
The provider-assigned unique ID for this managed resource.
- id String
The provider-assigned unique ID for this managed resource.
Look up Existing ContainerRepositoryIamBinding Resource
Get an existing ContainerRepositoryIamBinding resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: ContainerRepositoryIamBindingState, opts?: CustomResourceOptions): ContainerRepositoryIamBinding
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
members: Optional[Sequence[str]] = None,
repository_id: Optional[str] = None,
role: Optional[str] = None,
sleep_after: Optional[int] = None) -> ContainerRepositoryIamBinding
func GetContainerRepositoryIamBinding(ctx *Context, name string, id IDInput, state *ContainerRepositoryIamBindingState, opts ...ResourceOption) (*ContainerRepositoryIamBinding, error)
public static ContainerRepositoryIamBinding Get(string name, Input<string> id, ContainerRepositoryIamBindingState? state, CustomResourceOptions? opts = null)
public static ContainerRepositoryIamBinding get(String name, Output<String> id, ContainerRepositoryIamBindingState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Members List<string>
Identities that will be granted the privilege in
role
. Each entry can have one of the following values:- userAccount:{user_id}: A unique user ID that represents a specific Yandex account.
- serviceAccount:{service_account_id}: A unique service account ID.
- system:{allUsers|allAuthenticatedUsers}: see system groups
- Repository
Id string The Yandex Container Repository ID to apply a binding to.
- Role string
The role that should be applied. See roles.
- Sleep
After int
- Members []string
Identities that will be granted the privilege in
role
. Each entry can have one of the following values:- userAccount:{user_id}: A unique user ID that represents a specific Yandex account.
- serviceAccount:{service_account_id}: A unique service account ID.
- system:{allUsers|allAuthenticatedUsers}: see system groups
- Repository
Id string The Yandex Container Repository ID to apply a binding to.
- Role string
The role that should be applied. See roles.
- Sleep
After int
- members List<String>
Identities that will be granted the privilege in
role
. Each entry can have one of the following values:- userAccount:{user_id}: A unique user ID that represents a specific Yandex account.
- serviceAccount:{service_account_id}: A unique service account ID.
- system:{allUsers|allAuthenticatedUsers}: see system groups
- repository
Id String The Yandex Container Repository ID to apply a binding to.
- role String
The role that should be applied. See roles.
- sleep
After Integer
- members string[]
Identities that will be granted the privilege in
role
. Each entry can have one of the following values:- userAccount:{user_id}: A unique user ID that represents a specific Yandex account.
- serviceAccount:{service_account_id}: A unique service account ID.
- system:{allUsers|allAuthenticatedUsers}: see system groups
- repository
Id string The Yandex Container Repository ID to apply a binding to.
- role string
The role that should be applied. See roles.
- sleep
After number
- members Sequence[str]
Identities that will be granted the privilege in
role
. Each entry can have one of the following values:- userAccount:{user_id}: A unique user ID that represents a specific Yandex account.
- serviceAccount:{service_account_id}: A unique service account ID.
- system:{allUsers|allAuthenticatedUsers}: see system groups
- repository_
id str The Yandex Container Repository ID to apply a binding to.
- role str
The role that should be applied. See roles.
- sleep_
after int
- members List<String>
Identities that will be granted the privilege in
role
. Each entry can have one of the following values:- userAccount:{user_id}: A unique user ID that represents a specific Yandex account.
- serviceAccount:{service_account_id}: A unique service account ID.
- system:{allUsers|allAuthenticatedUsers}: see system groups
- repository
Id String The Yandex Container Repository ID to apply a binding to.
- role String
The role that should be applied. See roles.
- sleep
After Number
Import
IAM binding imports use space-delimited identifiers; first the resource in question and then the role. These bindings can be imported using the repository_id
and role, e.g.
$ pulumi import yandex:index/containerRepositoryIamBinding:ContainerRepositoryIamBinding puller "repository_id container-registry.images.puller"
Package Details
- Repository
- Yandex pulumi/pulumi-yandex
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
yandex
Terraform Provider.