ionoscloud.creg.RegistryToken
Explore with Pulumi AI
Manages an Container Registry Token on IonosCloud.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as ionoscloud from "@ionos-cloud/sdk-pulumi";
const example = new ionoscloud.creg.Registry("example", {
garbageCollectionSchedule: {
days: [
"Monday",
"Tuesday",
],
time: "05:19:00+00:00",
},
location: "de/fra",
name: "container-registry-example",
});
const exampleRegistryToken = new ionoscloud.creg.RegistryToken("example", {
expiryDate: "2023-01-13 16:27:42Z",
name: "container-registry-token-example",
scopes: [{
actions: ["push"],
name: "Scope1",
type: "repository",
}],
status: "enabled",
registryId: example.id,
savePasswordToFile: "pass.txt",
});
import pulumi
import pulumi_ionoscloud as ionoscloud
example = ionoscloud.creg.Registry("example",
garbage_collection_schedule={
"days": [
"Monday",
"Tuesday",
],
"time": "05:19:00+00:00",
},
location="de/fra",
name="container-registry-example")
example_registry_token = ionoscloud.creg.RegistryToken("example",
expiry_date="2023-01-13 16:27:42Z",
name="container-registry-token-example",
scopes=[{
"actions": ["push"],
"name": "Scope1",
"type": "repository",
}],
status="enabled",
registry_id=example.id,
save_password_to_file="pass.txt")
package main
import (
"github.com/ionos-cloud/pulumi-ionoscloud/sdk/go/ionoscloud/creg"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := creg.NewRegistry(ctx, "example", &creg.RegistryArgs{
GarbageCollectionSchedule: &creg.RegistryGarbageCollectionScheduleArgs{
Days: pulumi.StringArray{
pulumi.String("Monday"),
pulumi.String("Tuesday"),
},
Time: pulumi.String("05:19:00+00:00"),
},
Location: pulumi.String("de/fra"),
Name: pulumi.String("container-registry-example"),
})
if err != nil {
return err
}
_, err = creg.NewRegistryToken(ctx, "example", &creg.RegistryTokenArgs{
ExpiryDate: pulumi.String("2023-01-13 16:27:42Z"),
Name: pulumi.String("container-registry-token-example"),
Scopes: creg.RegistryTokenScopeArray{
&creg.RegistryTokenScopeArgs{
Actions: pulumi.StringArray{
pulumi.String("push"),
},
Name: pulumi.String("Scope1"),
Type: pulumi.String("repository"),
},
},
Status: pulumi.String("enabled"),
RegistryId: example.ID(),
SavePasswordToFile: pulumi.String("pass.txt"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ionoscloud = Ionoscloud.Pulumi.Ionoscloud;
return await Deployment.RunAsync(() =>
{
var example = new Ionoscloud.Creg.Registry("example", new()
{
GarbageCollectionSchedule = new Ionoscloud.Creg.Inputs.RegistryGarbageCollectionScheduleArgs
{
Days = new[]
{
"Monday",
"Tuesday",
},
Time = "05:19:00+00:00",
},
Location = "de/fra",
Name = "container-registry-example",
});
var exampleRegistryToken = new Ionoscloud.Creg.RegistryToken("example", new()
{
ExpiryDate = "2023-01-13 16:27:42Z",
Name = "container-registry-token-example",
Scopes = new[]
{
new Ionoscloud.Creg.Inputs.RegistryTokenScopeArgs
{
Actions = new[]
{
"push",
},
Name = "Scope1",
Type = "repository",
},
},
Status = "enabled",
RegistryId = example.Id,
SavePasswordToFile = "pass.txt",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ionoscloud.creg.Registry;
import com.pulumi.ionoscloud.creg.RegistryArgs;
import com.pulumi.ionoscloud.creg.inputs.RegistryGarbageCollectionScheduleArgs;
import com.pulumi.ionoscloud.creg.RegistryToken;
import com.pulumi.ionoscloud.creg.RegistryTokenArgs;
import com.pulumi.ionoscloud.creg.inputs.RegistryTokenScopeArgs;
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 example = new Registry("example", RegistryArgs.builder()
.garbageCollectionSchedule(RegistryGarbageCollectionScheduleArgs.builder()
.days(
"Monday",
"Tuesday")
.time("05:19:00+00:00")
.build())
.location("de/fra")
.name("container-registry-example")
.build());
var exampleRegistryToken = new RegistryToken("exampleRegistryToken", RegistryTokenArgs.builder()
.expiryDate("2023-01-13 16:27:42Z")
.name("container-registry-token-example")
.scopes(RegistryTokenScopeArgs.builder()
.actions("push")
.name("Scope1")
.type("repository")
.build())
.status("enabled")
.registryId(example.id())
.savePasswordToFile("pass.txt")
.build());
}
}
resources:
example:
type: ionoscloud:creg:Registry
properties:
garbageCollectionSchedule:
days:
- Monday
- Tuesday
time: 05:19:00+00:00
location: de/fra
name: container-registry-example
exampleRegistryToken:
type: ionoscloud:creg:RegistryToken
name: example
properties:
expiryDate: 2023-01-13 16:27:42Z
name: container-registry-token-example
scopes:
- actions:
- push
name: Scope1
type: repository
status: enabled
registryId: ${example.id}
savePasswordToFile: pass.txt
Create RegistryToken Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new RegistryToken(name: string, args: RegistryTokenArgs, opts?: CustomResourceOptions);
@overload
def RegistryToken(resource_name: str,
args: RegistryTokenArgs,
opts: Optional[ResourceOptions] = None)
@overload
def RegistryToken(resource_name: str,
opts: Optional[ResourceOptions] = None,
registry_id: Optional[str] = None,
expiry_date: Optional[str] = None,
name: Optional[str] = None,
save_password_to_file: Optional[str] = None,
scopes: Optional[Sequence[RegistryTokenScopeArgs]] = None,
status: Optional[str] = None)
func NewRegistryToken(ctx *Context, name string, args RegistryTokenArgs, opts ...ResourceOption) (*RegistryToken, error)
public RegistryToken(string name, RegistryTokenArgs args, CustomResourceOptions? opts = null)
public RegistryToken(String name, RegistryTokenArgs args)
public RegistryToken(String name, RegistryTokenArgs args, CustomResourceOptions options)
type: ionoscloud:creg:RegistryToken
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 RegistryTokenArgs
- 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 RegistryTokenArgs
- 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 RegistryTokenArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args RegistryTokenArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args RegistryTokenArgs
- 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 registryTokenResource = new Ionoscloud.Creg.RegistryToken("registryTokenResource", new()
{
RegistryId = "string",
ExpiryDate = "string",
Name = "string",
SavePasswordToFile = "string",
Scopes = new[]
{
new Ionoscloud.Creg.Inputs.RegistryTokenScopeArgs
{
Actions = new[]
{
"string",
},
Name = "string",
Type = "string",
},
},
Status = "string",
});
example, err := creg.NewRegistryToken(ctx, "registryTokenResource", &creg.RegistryTokenArgs{
RegistryId: pulumi.String("string"),
ExpiryDate: pulumi.String("string"),
Name: pulumi.String("string"),
SavePasswordToFile: pulumi.String("string"),
Scopes: creg.RegistryTokenScopeArray{
&creg.RegistryTokenScopeArgs{
Actions: pulumi.StringArray{
pulumi.String("string"),
},
Name: pulumi.String("string"),
Type: pulumi.String("string"),
},
},
Status: pulumi.String("string"),
})
var registryTokenResource = new RegistryToken("registryTokenResource", RegistryTokenArgs.builder()
.registryId("string")
.expiryDate("string")
.name("string")
.savePasswordToFile("string")
.scopes(RegistryTokenScopeArgs.builder()
.actions("string")
.name("string")
.type("string")
.build())
.status("string")
.build());
registry_token_resource = ionoscloud.creg.RegistryToken("registryTokenResource",
registry_id="string",
expiry_date="string",
name="string",
save_password_to_file="string",
scopes=[{
"actions": ["string"],
"name": "string",
"type": "string",
}],
status="string")
const registryTokenResource = new ionoscloud.creg.RegistryToken("registryTokenResource", {
registryId: "string",
expiryDate: "string",
name: "string",
savePasswordToFile: "string",
scopes: [{
actions: ["string"],
name: "string",
type: "string",
}],
status: "string",
});
type: ionoscloud:creg:RegistryToken
properties:
expiryDate: string
name: string
registryId: string
savePasswordToFile: string
scopes:
- actions:
- string
name: string
type: string
status: string
RegistryToken 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 RegistryToken resource accepts the following input properties:
- Registry
Id string - 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<Ionoscloud.
Registry Token Scope> - [map]
- Status string
- [string] Must have on of the values:
enabled
,disabled
- Registry
Id string - 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
[]Registry
Token Scope Args - [map]
- Status string
- [string] Must have on of the values:
enabled
,disabled
- registry
Id String - 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<Registry
Token Scope> - [map]
- status String
- [string] Must have on of the values:
enabled
,disabled
- registry
Id string - 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
Registry
Token Scope[] - [map]
- status string
- [string] Must have on of the values:
enabled
,disabled
- registry_
id str - 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[Registry
Token Scope Args] - [map]
- status str
- [string] Must have on of the values:
enabled
,disabled
- registry
Id String - 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>
- [map]
- status String
- [string] Must have on of the values:
enabled
,disabled
Outputs
All input properties are implicitly available as output properties. Additionally, the RegistryToken resource produces the following output properties:
- Credentials
List<Ionoscloud.
Registry Token Credential> - Id string
- The provider-assigned unique ID for this managed resource.
- Credentials
[]Registry
Token Credential - Id string
- The provider-assigned unique ID for this managed resource.
- credentials
List<Registry
Token Credential> - id String
- The provider-assigned unique ID for this managed resource.
- credentials
Registry
Token Credential[] - id string
- The provider-assigned unique ID for this managed resource.
- credentials
Sequence[Registry
Token Credential] - id str
- The provider-assigned unique ID for this managed resource.
- credentials List<Property Map>
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing RegistryToken Resource
Get an existing RegistryToken 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?: RegistryTokenState, opts?: CustomResourceOptions): RegistryToken
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
credentials: Optional[Sequence[RegistryTokenCredentialArgs]] = 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[RegistryTokenScopeArgs]] = None,
status: Optional[str] = None) -> RegistryToken
func GetRegistryToken(ctx *Context, name string, id IDInput, state *RegistryTokenState, opts ...ResourceOption) (*RegistryToken, error)
public static RegistryToken Get(string name, Input<string> id, RegistryTokenState? state, CustomResourceOptions? opts = null)
public static RegistryToken get(String name, Output<String> id, RegistryTokenState state, CustomResourceOptions options)
resources: _: type: ionoscloud:creg:RegistryToken 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.
- Credentials
List<Ionoscloud.
Registry Token Credential> - 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 - 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<Ionoscloud.
Registry Token Scope> - [map]
- Status string
- [string] Must have on of the values:
enabled
,disabled
- Credentials
[]Registry
Token Credential Args - 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 - 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
[]Registry
Token Scope Args - [map]
- Status string
- [string] Must have on of the values:
enabled
,disabled
- credentials
List<Registry
Token Credential> - 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 - 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<Registry
Token Scope> - [map]
- status String
- [string] Must have on of the values:
enabled
,disabled
- credentials
Registry
Token Credential[] - 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 - 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
Registry
Token Scope[] - [map]
- status string
- [string] Must have on of the values:
enabled
,disabled
- credentials
Sequence[Registry
Token Credential Args] - 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 - 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[Registry
Token Scope Args] - [map]
- status str
- [string] Must have on of the values:
enabled
,disabled
- credentials List<Property 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 - 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>
- [map]
- status String
- [string] Must have on of the values:
enabled
,disabled
Supporting Types
RegistryTokenCredential, RegistryTokenCredentialArgs
RegistryTokenScope, RegistryTokenScopeArgs
Import
Resource Container Registry Token can be imported using the container registry id
and resource id
, e.g.
$ pulumi import ionoscloud:creg/registryToken:RegistryToken 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/pulumi-ionoscloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
ionoscloud
Terraform Provider.