ovh.Okms.Credential
Explore with Pulumi AI
Creates a credential for an OVHcloud KMS.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as fs from "fs";
import * as ovh from "@ovhcloud/pulumi-ovh";
import * as ovh from "@pulumi/ovh";
const myaccount = ovh.Me.getMe({});
const credNoCsr = new ovh.okms.Credential("credNoCsr", {
okmsId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
identityUrns: [`urn:v1:eu:identity:account:${data.ovh_me.current_account.nichandle}`],
description: "Credential without CSR",
});
const credFromCsr = new ovh.okms.Credential("credFromCsr", {
okmsId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
identityUrns: [`urn:v1:eu:identity:account:${data.ovh_me.current_account.nichandle}`],
csr: fs.readFileSync("cred.csr", "utf8"),
description: "Credential from CSR",
});
import pulumi
import pulumi_ovh as ovh
myaccount = ovh.Me.get_me()
cred_no_csr = ovh.okms.Credential("credNoCsr",
okms_id="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
identity_urns=[f"urn:v1:eu:identity:account:{data['ovh_me']['current_account']['nichandle']}"],
description="Credential without CSR")
cred_from_csr = ovh.okms.Credential("credFromCsr",
okms_id="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
identity_urns=[f"urn:v1:eu:identity:account:{data['ovh_me']['current_account']['nichandle']}"],
csr=(lambda path: open(path).read())("cred.csr"),
description="Credential from CSR")
package main
import (
"fmt"
"os"
"github.com/ovh/pulumi-ovh/sdk/go/ovh/Me"
"github.com/ovh/pulumi-ovh/sdk/go/ovh/Okms"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func readFileOrPanic(path string) pulumi.StringPtrInput {
data, err := os.ReadFile(path)
if err != nil {
panic(err.Error())
}
return pulumi.String(string(data))
}
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := Me.GetMe(ctx, map[string]interface{}{}, nil)
if err != nil {
return err
}
_, err = Okms.NewCredential(ctx, "credNoCsr", &Okms.CredentialArgs{
OkmsId: pulumi.String("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"),
IdentityUrns: pulumi.StringArray{
pulumi.Sprintf("urn:v1:eu:identity:account:%v", data.Ovh_me.Current_account.Nichandle),
},
Description: pulumi.String("Credential without CSR"),
})
if err != nil {
return err
}
_, err = Okms.NewCredential(ctx, "credFromCsr", &Okms.CredentialArgs{
OkmsId: pulumi.String("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"),
IdentityUrns: pulumi.StringArray{
pulumi.Sprintf("urn:v1:eu:identity:account:%v", data.Ovh_me.Current_account.Nichandle),
},
Csr: pulumi.String(readFileOrPanic("cred.csr")),
Description: pulumi.String("Credential from CSR"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Pulumi;
using Ovh = Pulumi.Ovh;
return await Deployment.RunAsync(() =>
{
var myaccount = Ovh.Me.GetMe.Invoke();
var credNoCsr = new Ovh.Okms.Credential("credNoCsr", new()
{
OkmsId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
IdentityUrns = new[]
{
$"urn:v1:eu:identity:account:{data.Ovh_me.Current_account.Nichandle}",
},
Description = "Credential without CSR",
});
var credFromCsr = new Ovh.Okms.Credential("credFromCsr", new()
{
OkmsId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
IdentityUrns = new[]
{
$"urn:v1:eu:identity:account:{data.Ovh_me.Current_account.Nichandle}",
},
Csr = File.ReadAllText("cred.csr"),
Description = "Credential from CSR",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ovh.Me.MeFunctions;
import com.pulumi.ovh.Okms.Credential;
import com.pulumi.ovh.Okms.CredentialArgs;
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 myaccount = MeFunctions.getMe();
var credNoCsr = new Credential("credNoCsr", CredentialArgs.builder()
.okmsId("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx")
.identityUrns(String.format("urn:v1:eu:identity:account:%s", data.ovh_me().current_account().nichandle()))
.description("Credential without CSR")
.build());
var credFromCsr = new Credential("credFromCsr", CredentialArgs.builder()
.okmsId("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx")
.identityUrns(String.format("urn:v1:eu:identity:account:%s", data.ovh_me().current_account().nichandle()))
.csr(Files.readString(Paths.get("cred.csr")))
.description("Credential from CSR")
.build());
}
}
resources:
credNoCsr:
type: ovh:Okms:Credential
properties:
okmsId: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
identityUrns:
- urn:v1:eu:identity:account:${data.ovh_me.current_account.nichandle}
description: Credential without CSR
credFromCsr:
type: ovh:Okms:Credential
properties:
okmsId: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
identityUrns:
- urn:v1:eu:identity:account:${data.ovh_me.current_account.nichandle}
csr:
fn::readFile: cred.csr
description: Credential from CSR
variables:
myaccount:
fn::invoke:
Function: ovh:Me:getMe
Arguments: {}
Create Credential Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Credential(name: string, args: CredentialArgs, opts?: CustomResourceOptions);
@overload
def Credential(resource_name: str,
args: CredentialArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Credential(resource_name: str,
opts: Optional[ResourceOptions] = None,
identity_urns: Optional[Sequence[str]] = None,
okms_id: Optional[str] = None,
csr: Optional[str] = None,
description: Optional[str] = None,
name: Optional[str] = None,
validity: Optional[float] = None)
func NewCredential(ctx *Context, name string, args CredentialArgs, opts ...ResourceOption) (*Credential, error)
public Credential(string name, CredentialArgs args, CustomResourceOptions? opts = null)
public Credential(String name, CredentialArgs args)
public Credential(String name, CredentialArgs args, CustomResourceOptions options)
type: ovh:Okms:Credential
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 CredentialArgs
- 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 CredentialArgs
- 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 CredentialArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args CredentialArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args CredentialArgs
- 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 credentialResource = new Ovh.Okms.Credential("credentialResource", new()
{
IdentityUrns = new[]
{
"string",
},
OkmsId = "string",
Csr = "string",
Description = "string",
Name = "string",
Validity = 0,
});
example, err := Okms.NewCredential(ctx, "credentialResource", &Okms.CredentialArgs{
IdentityUrns: pulumi.StringArray{
pulumi.String("string"),
},
OkmsId: pulumi.String("string"),
Csr: pulumi.String("string"),
Description: pulumi.String("string"),
Name: pulumi.String("string"),
Validity: pulumi.Float64(0),
})
var credentialResource = new Credential("credentialResource", CredentialArgs.builder()
.identityUrns("string")
.okmsId("string")
.csr("string")
.description("string")
.name("string")
.validity(0)
.build());
credential_resource = ovh.okms.Credential("credentialResource",
identity_urns=["string"],
okms_id="string",
csr="string",
description="string",
name="string",
validity=0)
const credentialResource = new ovh.okms.Credential("credentialResource", {
identityUrns: ["string"],
okmsId: "string",
csr: "string",
description: "string",
name: "string",
validity: 0,
});
type: ovh:Okms:Credential
properties:
csr: string
description: string
identityUrns:
- string
name: string
okmsId: string
validity: 0
Credential 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 Credential resource accepts the following input properties:
- Identity
Urns List<string> - List of identity URNs associated with the credential (max 25)
- Okms
Id string - Okms ID
- Csr string
- Valid Certificate Signing Request
- Description string
- Description of the credential (max 200)
- Name string
- Name of the credential (max 50)
- Validity double
- Validity in days (default 365, max 365)
- Identity
Urns []string - List of identity URNs associated with the credential (max 25)
- Okms
Id string - Okms ID
- Csr string
- Valid Certificate Signing Request
- Description string
- Description of the credential (max 200)
- Name string
- Name of the credential (max 50)
- Validity float64
- Validity in days (default 365, max 365)
- identity
Urns List<String> - List of identity URNs associated with the credential (max 25)
- okms
Id String - Okms ID
- csr String
- Valid Certificate Signing Request
- description String
- Description of the credential (max 200)
- name String
- Name of the credential (max 50)
- validity Double
- Validity in days (default 365, max 365)
- identity
Urns string[] - List of identity URNs associated with the credential (max 25)
- okms
Id string - Okms ID
- csr string
- Valid Certificate Signing Request
- description string
- Description of the credential (max 200)
- name string
- Name of the credential (max 50)
- validity number
- Validity in days (default 365, max 365)
- identity_
urns Sequence[str] - List of identity URNs associated with the credential (max 25)
- okms_
id str - Okms ID
- csr str
- Valid Certificate Signing Request
- description str
- Description of the credential (max 200)
- name str
- Name of the credential (max 50)
- validity float
- Validity in days (default 365, max 365)
- identity
Urns List<String> - List of identity URNs associated with the credential (max 25)
- okms
Id String - Okms ID
- csr String
- Valid Certificate Signing Request
- description String
- Description of the credential (max 200)
- name String
- Name of the credential (max 50)
- validity Number
- Validity in days (default 365, max 365)
Outputs
All input properties are implicitly available as output properties. Additionally, the Credential resource produces the following output properties:
- Certificate
Pem string - (String) Certificate PEM of the credential.
- Created
At string - (String) Creation time of the credential
- Expired
At string - (String) Expiration time of the credential
- From
Csr bool - (Boolean) Whether the credential was generated from a CSR
- Id string
- The provider-assigned unique ID for this managed resource.
- Private
Key stringPem - (String, Sensitive) Private Key PEM of the credential if no CSR is provided
- Status string
- (String) Status of the credential
- Certificate
Pem string - (String) Certificate PEM of the credential.
- Created
At string - (String) Creation time of the credential
- Expired
At string - (String) Expiration time of the credential
- From
Csr bool - (Boolean) Whether the credential was generated from a CSR
- Id string
- The provider-assigned unique ID for this managed resource.
- Private
Key stringPem - (String, Sensitive) Private Key PEM of the credential if no CSR is provided
- Status string
- (String) Status of the credential
- certificate
Pem String - (String) Certificate PEM of the credential.
- created
At String - (String) Creation time of the credential
- expired
At String - (String) Expiration time of the credential
- from
Csr Boolean - (Boolean) Whether the credential was generated from a CSR
- id String
- The provider-assigned unique ID for this managed resource.
- private
Key StringPem - (String, Sensitive) Private Key PEM of the credential if no CSR is provided
- status String
- (String) Status of the credential
- certificate
Pem string - (String) Certificate PEM of the credential.
- created
At string - (String) Creation time of the credential
- expired
At string - (String) Expiration time of the credential
- from
Csr boolean - (Boolean) Whether the credential was generated from a CSR
- id string
- The provider-assigned unique ID for this managed resource.
- private
Key stringPem - (String, Sensitive) Private Key PEM of the credential if no CSR is provided
- status string
- (String) Status of the credential
- certificate_
pem str - (String) Certificate PEM of the credential.
- created_
at str - (String) Creation time of the credential
- expired_
at str - (String) Expiration time of the credential
- from_
csr bool - (Boolean) Whether the credential was generated from a CSR
- id str
- The provider-assigned unique ID for this managed resource.
- private_
key_ strpem - (String, Sensitive) Private Key PEM of the credential if no CSR is provided
- status str
- (String) Status of the credential
- certificate
Pem String - (String) Certificate PEM of the credential.
- created
At String - (String) Creation time of the credential
- expired
At String - (String) Expiration time of the credential
- from
Csr Boolean - (Boolean) Whether the credential was generated from a CSR
- id String
- The provider-assigned unique ID for this managed resource.
- private
Key StringPem - (String, Sensitive) Private Key PEM of the credential if no CSR is provided
- status String
- (String) Status of the credential
Look up Existing Credential Resource
Get an existing Credential 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?: CredentialState, opts?: CustomResourceOptions): Credential
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
certificate_pem: Optional[str] = None,
created_at: Optional[str] = None,
csr: Optional[str] = None,
description: Optional[str] = None,
expired_at: Optional[str] = None,
from_csr: Optional[bool] = None,
identity_urns: Optional[Sequence[str]] = None,
name: Optional[str] = None,
okms_id: Optional[str] = None,
private_key_pem: Optional[str] = None,
status: Optional[str] = None,
validity: Optional[float] = None) -> Credential
func GetCredential(ctx *Context, name string, id IDInput, state *CredentialState, opts ...ResourceOption) (*Credential, error)
public static Credential Get(string name, Input<string> id, CredentialState? state, CustomResourceOptions? opts = null)
public static Credential get(String name, Output<String> id, CredentialState 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.
- Certificate
Pem string - (String) Certificate PEM of the credential.
- Created
At string - (String) Creation time of the credential
- Csr string
- Valid Certificate Signing Request
- Description string
- Description of the credential (max 200)
- Expired
At string - (String) Expiration time of the credential
- From
Csr bool - (Boolean) Whether the credential was generated from a CSR
- Identity
Urns List<string> - List of identity URNs associated with the credential (max 25)
- Name string
- Name of the credential (max 50)
- Okms
Id string - Okms ID
- Private
Key stringPem - (String, Sensitive) Private Key PEM of the credential if no CSR is provided
- Status string
- (String) Status of the credential
- Validity double
- Validity in days (default 365, max 365)
- Certificate
Pem string - (String) Certificate PEM of the credential.
- Created
At string - (String) Creation time of the credential
- Csr string
- Valid Certificate Signing Request
- Description string
- Description of the credential (max 200)
- Expired
At string - (String) Expiration time of the credential
- From
Csr bool - (Boolean) Whether the credential was generated from a CSR
- Identity
Urns []string - List of identity URNs associated with the credential (max 25)
- Name string
- Name of the credential (max 50)
- Okms
Id string - Okms ID
- Private
Key stringPem - (String, Sensitive) Private Key PEM of the credential if no CSR is provided
- Status string
- (String) Status of the credential
- Validity float64
- Validity in days (default 365, max 365)
- certificate
Pem String - (String) Certificate PEM of the credential.
- created
At String - (String) Creation time of the credential
- csr String
- Valid Certificate Signing Request
- description String
- Description of the credential (max 200)
- expired
At String - (String) Expiration time of the credential
- from
Csr Boolean - (Boolean) Whether the credential was generated from a CSR
- identity
Urns List<String> - List of identity URNs associated with the credential (max 25)
- name String
- Name of the credential (max 50)
- okms
Id String - Okms ID
- private
Key StringPem - (String, Sensitive) Private Key PEM of the credential if no CSR is provided
- status String
- (String) Status of the credential
- validity Double
- Validity in days (default 365, max 365)
- certificate
Pem string - (String) Certificate PEM of the credential.
- created
At string - (String) Creation time of the credential
- csr string
- Valid Certificate Signing Request
- description string
- Description of the credential (max 200)
- expired
At string - (String) Expiration time of the credential
- from
Csr boolean - (Boolean) Whether the credential was generated from a CSR
- identity
Urns string[] - List of identity URNs associated with the credential (max 25)
- name string
- Name of the credential (max 50)
- okms
Id string - Okms ID
- private
Key stringPem - (String, Sensitive) Private Key PEM of the credential if no CSR is provided
- status string
- (String) Status of the credential
- validity number
- Validity in days (default 365, max 365)
- certificate_
pem str - (String) Certificate PEM of the credential.
- created_
at str - (String) Creation time of the credential
- csr str
- Valid Certificate Signing Request
- description str
- Description of the credential (max 200)
- expired_
at str - (String) Expiration time of the credential
- from_
csr bool - (Boolean) Whether the credential was generated from a CSR
- identity_
urns Sequence[str] - List of identity URNs associated with the credential (max 25)
- name str
- Name of the credential (max 50)
- okms_
id str - Okms ID
- private_
key_ strpem - (String, Sensitive) Private Key PEM of the credential if no CSR is provided
- status str
- (String) Status of the credential
- validity float
- Validity in days (default 365, max 365)
- certificate
Pem String - (String) Certificate PEM of the credential.
- created
At String - (String) Creation time of the credential
- csr String
- Valid Certificate Signing Request
- description String
- Description of the credential (max 200)
- expired
At String - (String) Expiration time of the credential
- from
Csr Boolean - (Boolean) Whether the credential was generated from a CSR
- identity
Urns List<String> - List of identity URNs associated with the credential (max 25)
- name String
- Name of the credential (max 50)
- okms
Id String - Okms ID
- private
Key StringPem - (String, Sensitive) Private Key PEM of the credential if no CSR is provided
- status String
- (String) Status of the credential
- validity Number
- Validity in days (default 365, max 365)
Package Details
- Repository
- ovh ovh/pulumi-ovh
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
ovh
Terraform Provider.