ionoscloud.ContainerRegistryToken
Explore with Pulumi AI
Manages an Container Registry Token on IonosCloud.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as ionoscloud from "@pulumi/ionoscloud";
const exampleContainerRegistry = new ionoscloud.ContainerRegistry("exampleContainerRegistry", {
garbageCollectionSchedule: {
days: [
"Monday",
"Tuesday",
],
time: "05:19:00+00:00",
},
location: "de/fra",
});
const exampleContainerRegistryToken = new ionoscloud.ContainerRegistryToken("exampleContainerRegistryToken", {
expiryDate: "2023-01-13 16:27:42Z",
scopes: [{
actions: ["push"],
name: "Scope1",
type: "repository",
}],
status: "enabled",
registryId: exampleContainerRegistry.containerRegistryId,
savePasswordToFile: "pass.txt",
});
import pulumi
import pulumi_ionoscloud as ionoscloud
example_container_registry = ionoscloud.ContainerRegistry("exampleContainerRegistry",
garbage_collection_schedule={
"days": [
"Monday",
"Tuesday",
],
"time": "05:19:00+00:00",
},
location="de/fra")
example_container_registry_token = ionoscloud.ContainerRegistryToken("exampleContainerRegistryToken",
expiry_date="2023-01-13 16:27:42Z",
scopes=[{
"actions": ["push"],
"name": "Scope1",
"type": "repository",
}],
status="enabled",
registry_id=example_container_registry.container_registry_id,
save_password_to_file="pass.txt")
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/ionoscloud/v6/ionoscloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
exampleContainerRegistry, err := ionoscloud.NewContainerRegistry(ctx, "exampleContainerRegistry", &ionoscloud.ContainerRegistryArgs{
GarbageCollectionSchedule: &ionoscloud.ContainerRegistryGarbageCollectionScheduleArgs{
Days: pulumi.StringArray{
pulumi.String("Monday"),
pulumi.String("Tuesday"),
},
Time: pulumi.String("05:19:00+00:00"),
},
Location: pulumi.String("de/fra"),
})
if err != nil {
return err
}
_, err = ionoscloud.NewContainerRegistryToken(ctx, "exampleContainerRegistryToken", &ionoscloud.ContainerRegistryTokenArgs{
ExpiryDate: pulumi.String("2023-01-13 16:27:42Z"),
Scopes: ionoscloud.ContainerRegistryTokenScopeArray{
&ionoscloud.ContainerRegistryTokenScopeArgs{
Actions: pulumi.StringArray{
pulumi.String("push"),
},
Name: pulumi.String("Scope1"),
Type: pulumi.String("repository"),
},
},
Status: pulumi.String("enabled"),
RegistryId: exampleContainerRegistry.ContainerRegistryId,
SavePasswordToFile: pulumi.String("pass.txt"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ionoscloud = Pulumi.Ionoscloud;
return await Deployment.RunAsync(() =>
{
var exampleContainerRegistry = new Ionoscloud.ContainerRegistry("exampleContainerRegistry", new()
{
GarbageCollectionSchedule = new Ionoscloud.Inputs.ContainerRegistryGarbageCollectionScheduleArgs
{
Days = new[]
{
"Monday",
"Tuesday",
},
Time = "05:19:00+00:00",
},
Location = "de/fra",
});
var exampleContainerRegistryToken = new Ionoscloud.ContainerRegistryToken("exampleContainerRegistryToken", new()
{
ExpiryDate = "2023-01-13 16:27:42Z",
Scopes = new[]
{
new Ionoscloud.Inputs.ContainerRegistryTokenScopeArgs
{
Actions = new[]
{
"push",
},
Name = "Scope1",
Type = "repository",
},
},
Status = "enabled",
RegistryId = exampleContainerRegistry.ContainerRegistryId,
SavePasswordToFile = "pass.txt",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ionoscloud.ContainerRegistry;
import com.pulumi.ionoscloud.ContainerRegistryArgs;
import com.pulumi.ionoscloud.inputs.ContainerRegistryGarbageCollectionScheduleArgs;
import com.pulumi.ionoscloud.ContainerRegistryToken;
import com.pulumi.ionoscloud.ContainerRegistryTokenArgs;
import com.pulumi.ionoscloud.inputs.ContainerRegistryTokenScopeArgs;
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) {
var exampleContainerRegistry = new ContainerRegistry("exampleContainerRegistry", ContainerRegistryArgs.builder()
.garbageCollectionSchedule(ContainerRegistryGarbageCollectionScheduleArgs.builder()
.days(
"Monday",
"Tuesday")
.time("05:19:00+00:00")
.build())
.location("de/fra")
.build());
var exampleContainerRegistryToken = new ContainerRegistryToken("exampleContainerRegistryToken", ContainerRegistryTokenArgs.builder()
.expiryDate("2023-01-13 16:27:42Z")
.scopes(ContainerRegistryTokenScopeArgs.builder()
.actions("push")
.name("Scope1")
.type("repository")
.build())
.status("enabled")
.registryId(exampleContainerRegistry.containerRegistryId())
.savePasswordToFile("pass.txt")
.build());
}
}
resources:
exampleContainerRegistry:
type: ionoscloud:ContainerRegistry
properties:
garbageCollectionSchedule:
days:
- Monday
- Tuesday
time: 05:19:00+00:00
location: de/fra
exampleContainerRegistryToken:
type: ionoscloud:ContainerRegistryToken
properties:
expiryDate: 2023-01-13 16:27:42Z
scopes:
- actions:
- push
name: Scope1
type: repository
status: enabled
registryId: ${exampleContainerRegistry.containerRegistryId}
savePasswordToFile: pass.txt
Create ContainerRegistryToken Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ContainerRegistryToken(name: string, args: ContainerRegistryTokenArgs, opts?: CustomResourceOptions);
@overload
def ContainerRegistryToken(resource_name: str,
args: ContainerRegistryTokenArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ContainerRegistryToken(resource_name: str,
opts: Optional[ResourceOptions] = None,
registry_id: Optional[str] = None,
container_registry_token_id: Optional[str] = None,
expiry_date: Optional[str] = None,
name: Optional[str] = None,
save_password_to_file: Optional[str] = None,
scopes: Optional[Sequence[ContainerRegistryTokenScopeArgs]] = None,
status: Optional[str] = None,
timeouts: Optional[ContainerRegistryTokenTimeoutsArgs] = None)
func NewContainerRegistryToken(ctx *Context, name string, args ContainerRegistryTokenArgs, opts ...ResourceOption) (*ContainerRegistryToken, error)
public ContainerRegistryToken(string name, ContainerRegistryTokenArgs args, CustomResourceOptions? opts = null)
public ContainerRegistryToken(String name, ContainerRegistryTokenArgs args)
public ContainerRegistryToken(String name, ContainerRegistryTokenArgs args, CustomResourceOptions options)
type: ionoscloud:ContainerRegistryToken
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args ContainerRegistryTokenArgs
- 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 ContainerRegistryTokenArgs
- 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 ContainerRegistryTokenArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ContainerRegistryTokenArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ContainerRegistryTokenArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var containerRegistryTokenResource = new Ionoscloud.ContainerRegistryToken("containerRegistryTokenResource", new()
{
RegistryId = "string",
ContainerRegistryTokenId = "string",
ExpiryDate = "string",
Name = "string",
SavePasswordToFile = "string",
Scopes = new[]
{
new Ionoscloud.Inputs.ContainerRegistryTokenScopeArgs
{
Actions = new[]
{
"string",
},
Name = "string",
Type = "string",
},
},
Status = "string",
Timeouts = new Ionoscloud.Inputs.ContainerRegistryTokenTimeoutsArgs
{
Create = "string",
Default = "string",
Delete = "string",
Update = "string",
},
});
example, err := ionoscloud.NewContainerRegistryToken(ctx, "containerRegistryTokenResource", &ionoscloud.ContainerRegistryTokenArgs{
RegistryId: pulumi.String("string"),
ContainerRegistryTokenId: pulumi.String("string"),
ExpiryDate: pulumi.String("string"),
Name: pulumi.String("string"),
SavePasswordToFile: pulumi.String("string"),
Scopes: ionoscloud.ContainerRegistryTokenScopeArray{
&ionoscloud.ContainerRegistryTokenScopeArgs{
Actions: pulumi.StringArray{
pulumi.String("string"),
},
Name: pulumi.String("string"),
Type: pulumi.String("string"),
},
},
Status: pulumi.String("string"),
Timeouts: &ionoscloud.ContainerRegistryTokenTimeoutsArgs{
Create: pulumi.String("string"),
Default: pulumi.String("string"),
Delete: pulumi.String("string"),
Update: pulumi.String("string"),
},
})
var containerRegistryTokenResource = new ContainerRegistryToken("containerRegistryTokenResource", ContainerRegistryTokenArgs.builder()
.registryId("string")
.containerRegistryTokenId("string")
.expiryDate("string")
.name("string")
.savePasswordToFile("string")
.scopes(ContainerRegistryTokenScopeArgs.builder()
.actions("string")
.name("string")
.type("string")
.build())
.status("string")
.timeouts(ContainerRegistryTokenTimeoutsArgs.builder()
.create("string")
.default_("string")
.delete("string")
.update("string")
.build())
.build());
container_registry_token_resource = ionoscloud.ContainerRegistryToken("containerRegistryTokenResource",
registry_id="string",
container_registry_token_id="string",
expiry_date="string",
name="string",
save_password_to_file="string",
scopes=[{
"actions": ["string"],
"name": "string",
"type": "string",
}],
status="string",
timeouts={
"create": "string",
"default": "string",
"delete": "string",
"update": "string",
})
const containerRegistryTokenResource = new ionoscloud.ContainerRegistryToken("containerRegistryTokenResource", {
registryId: "string",
containerRegistryTokenId: "string",
expiryDate: "string",
name: "string",
savePasswordToFile: "string",
scopes: [{
actions: ["string"],
name: "string",
type: "string",
}],
status: "string",
timeouts: {
create: "string",
"default": "string",
"delete": "string",
update: "string",
},
});
type: ionoscloud:ContainerRegistryToken
properties:
containerRegistryTokenId: string
expiryDate: string
name: string
registryId: string
savePasswordToFile: string
scopes:
- actions:
- string
name: string
type: string
status: string
timeouts:
create: string
default: string
delete: string
update: string
ContainerRegistryToken Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The ContainerRegistryToken resource accepts the following input properties:
- Registry
Id string - [string] The ID of the container registry
- Container
Registry stringToken Id - Expiry
Date string - Name string
- [string] The name of the container registry token. Immutable, update forces re-creation of the resource.
expiry-date
- (Optional)[string] The value must be supplied as ISO 8601 timestamp
- Save
Password stringTo File [string] Saves token password to file. Only works on create. Takes as argument a file name, or a file path
⚠ WARNING
save_password_to_file
must be used with caution. It will save the password(token) returned on create to a file. This is the only way to get the token.- Scopes
List<Container
Registry Token Scope> - (Computed) [map]
- Status string
- [string] Must have one of the values:
enabled
,disabled
- Timeouts
Container
Registry Token Timeouts
- Registry
Id string - [string] The ID of the container registry
- Container
Registry stringToken Id - Expiry
Date string - Name string
- [string] The name of the container registry token. Immutable, update forces re-creation of the resource.
expiry-date
- (Optional)[string] The value must be supplied as ISO 8601 timestamp
- Save
Password stringTo File [string] Saves token password to file. Only works on create. Takes as argument a file name, or a file path
⚠ WARNING
save_password_to_file
must be used with caution. It will save the password(token) returned on create to a file. This is the only way to get the token.- Scopes
[]Container
Registry Token Scope Args - (Computed) [map]
- Status string
- [string] Must have one of the values:
enabled
,disabled
- Timeouts
Container
Registry Token Timeouts Args
- registry
Id String - [string] The ID of the container registry
- container
Registry StringToken Id - expiry
Date String - name String
- [string] The name of the container registry token. Immutable, update forces re-creation of the resource.
expiry-date
- (Optional)[string] The value must be supplied as ISO 8601 timestamp
- save
Password StringTo File [string] Saves token password to file. Only works on create. Takes as argument a file name, or a file path
⚠ WARNING
save_password_to_file
must be used with caution. It will save the password(token) returned on create to a file. This is the only way to get the token.- scopes
List<Container
Registry Token Scope> - (Computed) [map]
- status String
- [string] Must have one of the values:
enabled
,disabled
- timeouts
Container
Registry Token Timeouts
- registry
Id string - [string] The ID of the container registry
- container
Registry stringToken Id - expiry
Date string - name string
- [string] The name of the container registry token. Immutable, update forces re-creation of the resource.
expiry-date
- (Optional)[string] The value must be supplied as ISO 8601 timestamp
- save
Password stringTo File [string] Saves token password to file. Only works on create. Takes as argument a file name, or a file path
⚠ WARNING
save_password_to_file
must be used with caution. It will save the password(token) returned on create to a file. This is the only way to get the token.- scopes
Container
Registry Token Scope[] - (Computed) [map]
- status string
- [string] Must have one of the values:
enabled
,disabled
- timeouts
Container
Registry Token Timeouts
- registry_
id str - [string] The ID of the container registry
- container_
registry_ strtoken_ id - expiry_
date str - name str
- [string] The name of the container registry token. Immutable, update forces re-creation of the resource.
expiry-date
- (Optional)[string] The value must be supplied as ISO 8601 timestamp
- save_
password_ strto_ file [string] Saves token password to file. Only works on create. Takes as argument a file name, or a file path
⚠ WARNING
save_password_to_file
must be used with caution. It will save the password(token) returned on create to a file. This is the only way to get the token.- scopes
Sequence[Container
Registry Token Scope Args] - (Computed) [map]
- status str
- [string] Must have one of the values:
enabled
,disabled
- timeouts
Container
Registry Token Timeouts Args
- registry
Id String - [string] The ID of the container registry
- container
Registry StringToken Id - expiry
Date String - name String
- [string] The name of the container registry token. Immutable, update forces re-creation of the resource.
expiry-date
- (Optional)[string] The value must be supplied as ISO 8601 timestamp
- save
Password StringTo File [string] Saves token password to file. Only works on create. Takes as argument a file name, or a file path
⚠ WARNING
save_password_to_file
must be used with caution. It will save the password(token) returned on create to a file. This is the only way to get the token.- scopes List<Property Map>
- (Computed) [map]
- status String
- [string] Must have one of the values:
enabled
,disabled
- timeouts Property Map
Outputs
All input properties are implicitly available as output properties. Additionally, the ContainerRegistryToken resource produces the following output properties:
- Credentials
List<Container
Registry Token Credential> - [map]
- Id string
- The provider-assigned unique ID for this managed resource.
- Credentials
[]Container
Registry Token Credential - [map]
- Id string
- The provider-assigned unique ID for this managed resource.
- credentials
List<Container
Registry Token Credential> - [map]
- id String
- The provider-assigned unique ID for this managed resource.
- credentials
Container
Registry Token Credential[] - [map]
- id string
- The provider-assigned unique ID for this managed resource.
- credentials
Sequence[Container
Registry Token Credential] - [map]
- id str
- The provider-assigned unique ID for this managed resource.
- credentials List<Property Map>
- [map]
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing ContainerRegistryToken Resource
Get an existing ContainerRegistryToken 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?: ContainerRegistryTokenState, opts?: CustomResourceOptions): ContainerRegistryToken
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
container_registry_token_id: Optional[str] = None,
credentials: Optional[Sequence[ContainerRegistryTokenCredentialArgs]] = None,
expiry_date: Optional[str] = None,
name: Optional[str] = None,
registry_id: Optional[str] = None,
save_password_to_file: Optional[str] = None,
scopes: Optional[Sequence[ContainerRegistryTokenScopeArgs]] = None,
status: Optional[str] = None,
timeouts: Optional[ContainerRegistryTokenTimeoutsArgs] = None) -> ContainerRegistryToken
func GetContainerRegistryToken(ctx *Context, name string, id IDInput, state *ContainerRegistryTokenState, opts ...ResourceOption) (*ContainerRegistryToken, error)
public static ContainerRegistryToken Get(string name, Input<string> id, ContainerRegistryTokenState? state, CustomResourceOptions? opts = null)
public static ContainerRegistryToken get(String name, Output<String> id, ContainerRegistryTokenState state, CustomResourceOptions options)
resources: _: type: ionoscloud:ContainerRegistryToken get: id: ${id}
- 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.
- Container
Registry stringToken Id - Credentials
List<Container
Registry Token Credential> - [map]
- Expiry
Date string - Name string
- [string] The name of the container registry token. Immutable, update forces re-creation of the resource.
expiry-date
- (Optional)[string] The value must be supplied as ISO 8601 timestamp
- Registry
Id string - [string] The ID of the container registry
- Save
Password stringTo File [string] Saves token password to file. Only works on create. Takes as argument a file name, or a file path
⚠ WARNING
save_password_to_file
must be used with caution. It will save the password(token) returned on create to a file. This is the only way to get the token.- Scopes
List<Container
Registry Token Scope> - (Computed) [map]
- Status string
- [string] Must have one of the values:
enabled
,disabled
- Timeouts
Container
Registry Token Timeouts
- Container
Registry stringToken Id - Credentials
[]Container
Registry Token Credential Args - [map]
- Expiry
Date string - Name string
- [string] The name of the container registry token. Immutable, update forces re-creation of the resource.
expiry-date
- (Optional)[string] The value must be supplied as ISO 8601 timestamp
- Registry
Id string - [string] The ID of the container registry
- Save
Password stringTo File [string] Saves token password to file. Only works on create. Takes as argument a file name, or a file path
⚠ WARNING
save_password_to_file
must be used with caution. It will save the password(token) returned on create to a file. This is the only way to get the token.- Scopes
[]Container
Registry Token Scope Args - (Computed) [map]
- Status string
- [string] Must have one of the values:
enabled
,disabled
- Timeouts
Container
Registry Token Timeouts Args
- container
Registry StringToken Id - credentials
List<Container
Registry Token Credential> - [map]
- expiry
Date String - name String
- [string] The name of the container registry token. Immutable, update forces re-creation of the resource.
expiry-date
- (Optional)[string] The value must be supplied as ISO 8601 timestamp
- registry
Id String - [string] The ID of the container registry
- save
Password StringTo File [string] Saves token password to file. Only works on create. Takes as argument a file name, or a file path
⚠ WARNING
save_password_to_file
must be used with caution. It will save the password(token) returned on create to a file. This is the only way to get the token.- scopes
List<Container
Registry Token Scope> - (Computed) [map]
- status String
- [string] Must have one of the values:
enabled
,disabled
- timeouts
Container
Registry Token Timeouts
- container
Registry stringToken Id - credentials
Container
Registry Token Credential[] - [map]
- expiry
Date string - name string
- [string] The name of the container registry token. Immutable, update forces re-creation of the resource.
expiry-date
- (Optional)[string] The value must be supplied as ISO 8601 timestamp
- registry
Id string - [string] The ID of the container registry
- save
Password stringTo File [string] Saves token password to file. Only works on create. Takes as argument a file name, or a file path
⚠ WARNING
save_password_to_file
must be used with caution. It will save the password(token) returned on create to a file. This is the only way to get the token.- scopes
Container
Registry Token Scope[] - (Computed) [map]
- status string
- [string] Must have one of the values:
enabled
,disabled
- timeouts
Container
Registry Token Timeouts
- container_
registry_ strtoken_ id - credentials
Sequence[Container
Registry Token Credential Args] - [map]
- expiry_
date str - name str
- [string] The name of the container registry token. Immutable, update forces re-creation of the resource.
expiry-date
- (Optional)[string] The value must be supplied as ISO 8601 timestamp
- registry_
id str - [string] The ID of the container registry
- save_
password_ strto_ file [string] Saves token password to file. Only works on create. Takes as argument a file name, or a file path
⚠ WARNING
save_password_to_file
must be used with caution. It will save the password(token) returned on create to a file. This is the only way to get the token.- scopes
Sequence[Container
Registry Token Scope Args] - (Computed) [map]
- status str
- [string] Must have one of the values:
enabled
,disabled
- timeouts
Container
Registry Token Timeouts Args
- container
Registry StringToken Id - credentials List<Property Map>
- [map]
- expiry
Date String - name String
- [string] The name of the container registry token. Immutable, update forces re-creation of the resource.
expiry-date
- (Optional)[string] The value must be supplied as ISO 8601 timestamp
- registry
Id String - [string] The ID of the container registry
- save
Password StringTo File [string] Saves token password to file. Only works on create. Takes as argument a file name, or a file path
⚠ WARNING
save_password_to_file
must be used with caution. It will save the password(token) returned on create to a file. This is the only way to get the token.- scopes List<Property Map>
- (Computed) [map]
- status String
- [string] Must have one of the values:
enabled
,disabled
- timeouts Property Map
Supporting Types
ContainerRegistryTokenCredential, ContainerRegistryTokenCredentialArgs
ContainerRegistryTokenScope, ContainerRegistryTokenScopeArgs
ContainerRegistryTokenTimeouts, ContainerRegistryTokenTimeoutsArgs
Import
Resource Container Registry Token can be imported using the container registry id
and resource id
, e.g.
$ pulumi import ionoscloud:index/containerRegistryToken:ContainerRegistryToken mycrtoken container_registry uuid/container_registry_token uuid
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- ionoscloud ionos-cloud/terraform-provider-ionoscloud
- License
- Notes
- This Pulumi package is based on the
ionoscloud
Terraform Provider.