equinix.metal.ProjectSshKey
Explore with Pulumi AI
Provides an Equinix Metal project SSH key resource to manage project-specific SSH keys. Project SSH keys will only be populated onto servers that belong to that project, in contrast to User SSH Keys.
Example Usage
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Equinix = Pulumi.Equinix;
return await Deployment.RunAsync(() =>
{
var projectId = "<UUID_of_your_project>";
var test = new Equinix.Metal.ProjectSshKey("test", new()
{
Name = "test",
PublicKey = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDM/unxJeFqxsTJcu6mhqsMHSaVlpu+Jj/P+44zrm6X/MAoHSX3X9oLgujEjjZ74yLfdfe0bJrbL2YgJzNaEkIQQ1VPMHB5EhTKUBGnzlPP0hHTnxsjAm9qDHgUPgvgFDQSAMzdJRJ0Cexo16Ph9VxCoLh3dxiE7s2gaM2FdVg7P8aSxKypsxAhYV3D0AwqzoOyT6WWhBoQ0xZ85XevOTnJCpImSemEGs6nVGEsWcEc1d1YvdxFjAK4SdsKUMkj4Dsy/leKsdi/DEAf356vbMT1UHsXXvy5TlHu/Pa6qF53v32Enz+nhKy7/8W2Yt2yWx8HnQcT2rug9lvCXagJO6oauqRTO77C4QZn13ZLMZgLT66S/tNh2EX0gi6vmIs5dth8uF+K6nxIyKJXbcA4ASg7F1OJrHKFZdTc5v1cPeq6PcbqGgc+8SrPYQmzvQqLoMBuxyos2hUkYOmw3aeWJj9nFa8Wu5WaN89mUeOqSkU4S5cgUzWUOmKey56B/j/s1sVys9rMhZapVs0wL4L9GBBM48N5jAQZnnpo85A8KsZq5ME22bTLqnxsDXqDYZvS7PSI6Dxi7eleOFE/NYYDkrgDLHTQri8ucDMVeVWHgoMY2bPXdn7KKy5jW5jKsf8EPARXg77A4gRYmgKrcwIKqJEUPqyxJBe0CPoGTqgXPRsUiQ== tomk@hp2",
ProjectId = projectId,
});
var testDevice = new Equinix.Metal.Device("testDevice", new()
{
Hostname = "test",
Plan = Equinix.Metal.Plan.C3MediumX86,
Metro = "ny",
OperatingSystem = Equinix.Metal.OperatingSystem.Ubuntu20_04,
BillingCycle = Equinix.Metal.BillingCycle.Hourly,
ProjectSshKeyIds = new[]
{
test.Id,
},
ProjectId = projectId,
});
});
package main
import (
"github.com/equinix/pulumi-equinix/sdk/go/equinix/metal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
projectId := "<UUID_of_your_project>"
test, err := metal.NewProjectSshKey(ctx, "test", &metal.ProjectSshKeyArgs{
Name: pulumi.String("test"),
PublicKey: pulumi.String("ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDM/unxJeFqxsTJcu6mhqsMHSaVlpu+Jj/P+44zrm6X/MAoHSX3X9oLgujEjjZ74yLfdfe0bJrbL2YgJzNaEkIQQ1VPMHB5EhTKUBGnzlPP0hHTnxsjAm9qDHgUPgvgFDQSAMzdJRJ0Cexo16Ph9VxCoLh3dxiE7s2gaM2FdVg7P8aSxKypsxAhYV3D0AwqzoOyT6WWhBoQ0xZ85XevOTnJCpImSemEGs6nVGEsWcEc1d1YvdxFjAK4SdsKUMkj4Dsy/leKsdi/DEAf356vbMT1UHsXXvy5TlHu/Pa6qF53v32Enz+nhKy7/8W2Yt2yWx8HnQcT2rug9lvCXagJO6oauqRTO77C4QZn13ZLMZgLT66S/tNh2EX0gi6vmIs5dth8uF+K6nxIyKJXbcA4ASg7F1OJrHKFZdTc5v1cPeq6PcbqGgc+8SrPYQmzvQqLoMBuxyos2hUkYOmw3aeWJj9nFa8Wu5WaN89mUeOqSkU4S5cgUzWUOmKey56B/j/s1sVys9rMhZapVs0wL4L9GBBM48N5jAQZnnpo85A8KsZq5ME22bTLqnxsDXqDYZvS7PSI6Dxi7eleOFE/NYYDkrgDLHTQri8ucDMVeVWHgoMY2bPXdn7KKy5jW5jKsf8EPARXg77A4gRYmgKrcwIKqJEUPqyxJBe0CPoGTqgXPRsUiQ== tomk@hp2"),
ProjectId: pulumi.String(projectId),
})
if err != nil {
return err
}
_, err = metal.NewDevice(ctx, "testDevice", &metal.DeviceArgs{
Hostname: pulumi.String("test"),
Plan: pulumi.String(metal.PlanC3MediumX86),
Metro: pulumi.String("ny"),
OperatingSystem: pulumi.String(metal.OperatingSystem_Ubuntu20_04),
BillingCycle: pulumi.String(metal.BillingCycleHourly),
ProjectSshKeyIds: pulumi.StringArray{
test.ID(),
},
ProjectId: pulumi.String(projectId),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.equinix.metal.ProjectSshKey;
import com.pulumi.equinix.metal.ProjectSshKeyArgs;
import com.pulumi.equinix.metal.Device;
import com.pulumi.equinix.metal.DeviceArgs;
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 projectId = "<UUID_of_your_project>";
var test = new ProjectSshKey("test", ProjectSshKeyArgs.builder()
.name("test")
.publicKey("ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDM/unxJeFqxsTJcu6mhqsMHSaVlpu+Jj/P+44zrm6X/MAoHSX3X9oLgujEjjZ74yLfdfe0bJrbL2YgJzNaEkIQQ1VPMHB5EhTKUBGnzlPP0hHTnxsjAm9qDHgUPgvgFDQSAMzdJRJ0Cexo16Ph9VxCoLh3dxiE7s2gaM2FdVg7P8aSxKypsxAhYV3D0AwqzoOyT6WWhBoQ0xZ85XevOTnJCpImSemEGs6nVGEsWcEc1d1YvdxFjAK4SdsKUMkj4Dsy/leKsdi/DEAf356vbMT1UHsXXvy5TlHu/Pa6qF53v32Enz+nhKy7/8W2Yt2yWx8HnQcT2rug9lvCXagJO6oauqRTO77C4QZn13ZLMZgLT66S/tNh2EX0gi6vmIs5dth8uF+K6nxIyKJXbcA4ASg7F1OJrHKFZdTc5v1cPeq6PcbqGgc+8SrPYQmzvQqLoMBuxyos2hUkYOmw3aeWJj9nFa8Wu5WaN89mUeOqSkU4S5cgUzWUOmKey56B/j/s1sVys9rMhZapVs0wL4L9GBBM48N5jAQZnnpo85A8KsZq5ME22bTLqnxsDXqDYZvS7PSI6Dxi7eleOFE/NYYDkrgDLHTQri8ucDMVeVWHgoMY2bPXdn7KKy5jW5jKsf8EPARXg77A4gRYmgKrcwIKqJEUPqyxJBe0CPoGTqgXPRsUiQ== tomk@hp2")
.projectId(projectId)
.build());
var testDevice = new Device("testDevice", DeviceArgs.builder()
.hostname("test")
.plan("c3.medium.x86")
.metro("ny")
.operatingSystem("ubuntu_20_04")
.billingCycle("hourly")
.projectSshKeyIds(test.id())
.projectId(projectId)
.build());
}
}
import pulumi
import pulumi_equinix as equinix
project_id = "<UUID_of_your_project>"
test = equinix.metal.ProjectSshKey("test",
name="test",
public_key="ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDM/unxJeFqxsTJcu6mhqsMHSaVlpu+Jj/P+44zrm6X/MAoHSX3X9oLgujEjjZ74yLfdfe0bJrbL2YgJzNaEkIQQ1VPMHB5EhTKUBGnzlPP0hHTnxsjAm9qDHgUPgvgFDQSAMzdJRJ0Cexo16Ph9VxCoLh3dxiE7s2gaM2FdVg7P8aSxKypsxAhYV3D0AwqzoOyT6WWhBoQ0xZ85XevOTnJCpImSemEGs6nVGEsWcEc1d1YvdxFjAK4SdsKUMkj4Dsy/leKsdi/DEAf356vbMT1UHsXXvy5TlHu/Pa6qF53v32Enz+nhKy7/8W2Yt2yWx8HnQcT2rug9lvCXagJO6oauqRTO77C4QZn13ZLMZgLT66S/tNh2EX0gi6vmIs5dth8uF+K6nxIyKJXbcA4ASg7F1OJrHKFZdTc5v1cPeq6PcbqGgc+8SrPYQmzvQqLoMBuxyos2hUkYOmw3aeWJj9nFa8Wu5WaN89mUeOqSkU4S5cgUzWUOmKey56B/j/s1sVys9rMhZapVs0wL4L9GBBM48N5jAQZnnpo85A8KsZq5ME22bTLqnxsDXqDYZvS7PSI6Dxi7eleOFE/NYYDkrgDLHTQri8ucDMVeVWHgoMY2bPXdn7KKy5jW5jKsf8EPARXg77A4gRYmgKrcwIKqJEUPqyxJBe0CPoGTqgXPRsUiQ== tomk@hp2",
project_id=project_id)
test_device = equinix.metal.Device("testDevice",
hostname="test",
plan=equinix.metal.Plan.C3_MEDIUM_X86,
metro="ny",
operating_system=equinix.metal.OperatingSystem.UBUNTU20_04,
billing_cycle=equinix.metal.BillingCycle.HOURLY,
project_ssh_key_ids=[test.id],
project_id=project_id)
import * as pulumi from "@pulumi/pulumi";
import * as equinix from "@equinix-labs/pulumi-equinix";
const projectId = "<UUID_of_your_project>";
const test = new equinix.metal.ProjectSshKey("test", {
name: "test",
publicKey: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDM/unxJeFqxsTJcu6mhqsMHSaVlpu+Jj/P+44zrm6X/MAoHSX3X9oLgujEjjZ74yLfdfe0bJrbL2YgJzNaEkIQQ1VPMHB5EhTKUBGnzlPP0hHTnxsjAm9qDHgUPgvgFDQSAMzdJRJ0Cexo16Ph9VxCoLh3dxiE7s2gaM2FdVg7P8aSxKypsxAhYV3D0AwqzoOyT6WWhBoQ0xZ85XevOTnJCpImSemEGs6nVGEsWcEc1d1YvdxFjAK4SdsKUMkj4Dsy/leKsdi/DEAf356vbMT1UHsXXvy5TlHu/Pa6qF53v32Enz+nhKy7/8W2Yt2yWx8HnQcT2rug9lvCXagJO6oauqRTO77C4QZn13ZLMZgLT66S/tNh2EX0gi6vmIs5dth8uF+K6nxIyKJXbcA4ASg7F1OJrHKFZdTc5v1cPeq6PcbqGgc+8SrPYQmzvQqLoMBuxyos2hUkYOmw3aeWJj9nFa8Wu5WaN89mUeOqSkU4S5cgUzWUOmKey56B/j/s1sVys9rMhZapVs0wL4L9GBBM48N5jAQZnnpo85A8KsZq5ME22bTLqnxsDXqDYZvS7PSI6Dxi7eleOFE/NYYDkrgDLHTQri8ucDMVeVWHgoMY2bPXdn7KKy5jW5jKsf8EPARXg77A4gRYmgKrcwIKqJEUPqyxJBe0CPoGTqgXPRsUiQ== tomk@hp2",
projectId: projectId,
});
const testDevice = new equinix.metal.Device("testDevice", {
hostname: "test",
plan: equinix.metal.Plan.C3MediumX86,
metro: "ny",
operatingSystem: equinix.metal.OperatingSystem.Ubuntu20_04,
billingCycle: equinix.metal.BillingCycle.Hourly,
projectSshKeyIds: [test.id],
projectId: projectId,
});
resources:
test:
type: equinix:metal:ProjectSshKey
properties:
name: test
publicKey: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDM/unxJeFqxsTJcu6mhqsMHSaVlpu+Jj/P+44zrm6X/MAoHSX3X9oLgujEjjZ74yLfdfe0bJrbL2YgJzNaEkIQQ1VPMHB5EhTKUBGnzlPP0hHTnxsjAm9qDHgUPgvgFDQSAMzdJRJ0Cexo16Ph9VxCoLh3dxiE7s2gaM2FdVg7P8aSxKypsxAhYV3D0AwqzoOyT6WWhBoQ0xZ85XevOTnJCpImSemEGs6nVGEsWcEc1d1YvdxFjAK4SdsKUMkj4Dsy/leKsdi/DEAf356vbMT1UHsXXvy5TlHu/Pa6qF53v32Enz+nhKy7/8W2Yt2yWx8HnQcT2rug9lvCXagJO6oauqRTO77C4QZn13ZLMZgLT66S/tNh2EX0gi6vmIs5dth8uF+K6nxIyKJXbcA4ASg7F1OJrHKFZdTc5v1cPeq6PcbqGgc+8SrPYQmzvQqLoMBuxyos2hUkYOmw3aeWJj9nFa8Wu5WaN89mUeOqSkU4S5cgUzWUOmKey56B/j/s1sVys9rMhZapVs0wL4L9GBBM48N5jAQZnnpo85A8KsZq5ME22bTLqnxsDXqDYZvS7PSI6Dxi7eleOFE/NYYDkrgDLHTQri8ucDMVeVWHgoMY2bPXdn7KKy5jW5jKsf8EPARXg77A4gRYmgKrcwIKqJEUPqyxJBe0CPoGTqgXPRsUiQ== tomk@hp2
projectId: ${projectId}
testDevice:
type: equinix:metal:Device
name: test
properties:
hostname: test
plan: c3.medium.x86
metro: ny
operatingSystem: ubuntu_20_04
billingCycle: hourly
projectSshKeyIds:
- ${test.id}
projectId: ${projectId}
variables:
projectId: <UUID_of_your_project>
Create ProjectSshKey Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ProjectSshKey(name: string, args: ProjectSshKeyArgs, opts?: CustomResourceOptions);
@overload
def ProjectSshKey(resource_name: str,
args: ProjectSshKeyArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ProjectSshKey(resource_name: str,
opts: Optional[ResourceOptions] = None,
project_id: Optional[str] = None,
public_key: Optional[str] = None,
name: Optional[str] = None)
func NewProjectSshKey(ctx *Context, name string, args ProjectSshKeyArgs, opts ...ResourceOption) (*ProjectSshKey, error)
public ProjectSshKey(string name, ProjectSshKeyArgs args, CustomResourceOptions? opts = null)
public ProjectSshKey(String name, ProjectSshKeyArgs args)
public ProjectSshKey(String name, ProjectSshKeyArgs args, CustomResourceOptions options)
type: equinix:metal:ProjectSshKey
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 ProjectSshKeyArgs
- 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 ProjectSshKeyArgs
- 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 ProjectSshKeyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ProjectSshKeyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ProjectSshKeyArgs
- 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 projectSshKeyResource = new Equinix.Metal.ProjectSshKey("projectSshKeyResource", new()
{
ProjectId = "string",
PublicKey = "string",
Name = "string",
});
example, err := metal.NewProjectSshKey(ctx, "projectSshKeyResource", &metal.ProjectSshKeyArgs{
ProjectId: pulumi.String("string"),
PublicKey: pulumi.String("string"),
Name: pulumi.String("string"),
})
var projectSshKeyResource = new ProjectSshKey("projectSshKeyResource", ProjectSshKeyArgs.builder()
.projectId("string")
.publicKey("string")
.name("string")
.build());
project_ssh_key_resource = equinix.metal.ProjectSshKey("projectSshKeyResource",
project_id="string",
public_key="string",
name="string")
const projectSshKeyResource = new equinix.metal.ProjectSshKey("projectSshKeyResource", {
projectId: "string",
publicKey: "string",
name: "string",
});
type: equinix:metal:ProjectSshKey
properties:
name: string
projectId: string
publicKey: string
ProjectSshKey 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 ProjectSshKey resource accepts the following input properties:
- project_
id str - The ID of parent project.
- public_
key str - The public key. If this is a file, it can be read using the file interpolation function.
- name str
- The name of the SSH key for identification.
Outputs
All input properties are implicitly available as output properties. Additionally, the ProjectSshKey resource produces the following output properties:
- Created string
- The timestamp for when the SSH key was created.
- Fingerprint string
- The fingerprint of the SSH key.
- Id string
- The provider-assigned unique ID for this managed resource.
- Owner
Id string - The ID of parent project (same as project_id).
- Updated string
- The timestamp for the last time the SSH key was updated.
- Created string
- The timestamp for when the SSH key was created.
- Fingerprint string
- The fingerprint of the SSH key.
- Id string
- The provider-assigned unique ID for this managed resource.
- Owner
Id string - The ID of parent project (same as project_id).
- Updated string
- The timestamp for the last time the SSH key was updated.
- created String
- The timestamp for when the SSH key was created.
- fingerprint String
- The fingerprint of the SSH key.
- id String
- The provider-assigned unique ID for this managed resource.
- owner
Id String - The ID of parent project (same as project_id).
- updated String
- The timestamp for the last time the SSH key was updated.
- created string
- The timestamp for when the SSH key was created.
- fingerprint string
- The fingerprint of the SSH key.
- id string
- The provider-assigned unique ID for this managed resource.
- owner
Id string - The ID of parent project (same as project_id).
- updated string
- The timestamp for the last time the SSH key was updated.
- created str
- The timestamp for when the SSH key was created.
- fingerprint str
- The fingerprint of the SSH key.
- id str
- The provider-assigned unique ID for this managed resource.
- owner_
id str - The ID of parent project (same as project_id).
- updated str
- The timestamp for the last time the SSH key was updated.
- created String
- The timestamp for when the SSH key was created.
- fingerprint String
- The fingerprint of the SSH key.
- id String
- The provider-assigned unique ID for this managed resource.
- owner
Id String - The ID of parent project (same as project_id).
- updated String
- The timestamp for the last time the SSH key was updated.
Look up Existing ProjectSshKey Resource
Get an existing ProjectSshKey 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?: ProjectSshKeyState, opts?: CustomResourceOptions): ProjectSshKey
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
created: Optional[str] = None,
fingerprint: Optional[str] = None,
name: Optional[str] = None,
owner_id: Optional[str] = None,
project_id: Optional[str] = None,
public_key: Optional[str] = None,
updated: Optional[str] = None) -> ProjectSshKey
func GetProjectSshKey(ctx *Context, name string, id IDInput, state *ProjectSshKeyState, opts ...ResourceOption) (*ProjectSshKey, error)
public static ProjectSshKey Get(string name, Input<string> id, ProjectSshKeyState? state, CustomResourceOptions? opts = null)
public static ProjectSshKey get(String name, Output<String> id, ProjectSshKeyState 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.
- Created string
- The timestamp for when the SSH key was created.
- Fingerprint string
- The fingerprint of the SSH key.
- Name string
- The name of the SSH key for identification.
- Owner
Id string - The ID of parent project (same as project_id).
- Project
Id string - The ID of parent project.
- Public
Key string - The public key. If this is a file, it can be read using the file interpolation function.
- Updated string
- The timestamp for the last time the SSH key was updated.
- Created string
- The timestamp for when the SSH key was created.
- Fingerprint string
- The fingerprint of the SSH key.
- Name string
- The name of the SSH key for identification.
- Owner
Id string - The ID of parent project (same as project_id).
- Project
Id string - The ID of parent project.
- Public
Key string - The public key. If this is a file, it can be read using the file interpolation function.
- Updated string
- The timestamp for the last time the SSH key was updated.
- created String
- The timestamp for when the SSH key was created.
- fingerprint String
- The fingerprint of the SSH key.
- name String
- The name of the SSH key for identification.
- owner
Id String - The ID of parent project (same as project_id).
- project
Id String - The ID of parent project.
- public
Key String - The public key. If this is a file, it can be read using the file interpolation function.
- updated String
- The timestamp for the last time the SSH key was updated.
- created string
- The timestamp for when the SSH key was created.
- fingerprint string
- The fingerprint of the SSH key.
- name string
- The name of the SSH key for identification.
- owner
Id string - The ID of parent project (same as project_id).
- project
Id string - The ID of parent project.
- public
Key string - The public key. If this is a file, it can be read using the file interpolation function.
- updated string
- The timestamp for the last time the SSH key was updated.
- created str
- The timestamp for when the SSH key was created.
- fingerprint str
- The fingerprint of the SSH key.
- name str
- The name of the SSH key for identification.
- owner_
id str - The ID of parent project (same as project_id).
- project_
id str - The ID of parent project.
- public_
key str - The public key. If this is a file, it can be read using the file interpolation function.
- updated str
- The timestamp for the last time the SSH key was updated.
- created String
- The timestamp for when the SSH key was created.
- fingerprint String
- The fingerprint of the SSH key.
- name String
- The name of the SSH key for identification.
- owner
Id String - The ID of parent project (same as project_id).
- project
Id String - The ID of parent project.
- public
Key String - The public key. If this is a file, it can be read using the file interpolation function.
- updated String
- The timestamp for the last time the SSH key was updated.
Package Details
- Repository
- equinix equinix/pulumi-equinix
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
equinix
Terraform Provider.