published on Thursday, May 7, 2026 by rootlyhq
published on Thursday, May 7, 2026 by rootlyhq
Example Usage
resource "rootly_api_key" "ci_pipeline" {
name = "CI Pipeline"
expires_at = "2027-01-01T00:00:00Z"
}
Create ApiKey Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ApiKey(name: string, args: ApiKeyArgs, opts?: CustomResourceOptions);@overload
def ApiKey(resource_name: str,
args: ApiKeyArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ApiKey(resource_name: str,
opts: Optional[ResourceOptions] = None,
expires_at: Optional[str] = None,
description: Optional[str] = None,
grace_period_ends_at: Optional[str] = None,
kind: Optional[str] = None,
last_used_at: Optional[str] = None,
name: Optional[str] = None,
on_call_role_id: Optional[str] = None,
role_id: Optional[str] = None)func NewApiKey(ctx *Context, name string, args ApiKeyArgs, opts ...ResourceOption) (*ApiKey, error)public ApiKey(string name, ApiKeyArgs args, CustomResourceOptions? opts = null)
public ApiKey(String name, ApiKeyArgs args)
public ApiKey(String name, ApiKeyArgs args, CustomResourceOptions options)
type: rootly:ApiKey
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 ApiKeyArgs
- 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 ApiKeyArgs
- 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 ApiKeyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ApiKeyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ApiKeyArgs
- 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 apiKeyResource = new Rootly.ApiKey("apiKeyResource", new()
{
ExpiresAt = "string",
Description = "string",
GracePeriodEndsAt = "string",
Kind = "string",
LastUsedAt = "string",
Name = "string",
OnCallRoleId = "string",
RoleId = "string",
});
example, err := rootly.NewApiKey(ctx, "apiKeyResource", &rootly.ApiKeyArgs{
ExpiresAt: pulumi.String("string"),
Description: pulumi.String("string"),
GracePeriodEndsAt: pulumi.String("string"),
Kind: pulumi.String("string"),
LastUsedAt: pulumi.String("string"),
Name: pulumi.String("string"),
OnCallRoleId: pulumi.String("string"),
RoleId: pulumi.String("string"),
})
var apiKeyResource = new ApiKey("apiKeyResource", ApiKeyArgs.builder()
.expiresAt("string")
.description("string")
.gracePeriodEndsAt("string")
.kind("string")
.lastUsedAt("string")
.name("string")
.onCallRoleId("string")
.roleId("string")
.build());
api_key_resource = rootly.ApiKey("apiKeyResource",
expires_at="string",
description="string",
grace_period_ends_at="string",
kind="string",
last_used_at="string",
name="string",
on_call_role_id="string",
role_id="string")
const apiKeyResource = new rootly.ApiKey("apiKeyResource", {
expiresAt: "string",
description: "string",
gracePeriodEndsAt: "string",
kind: "string",
lastUsedAt: "string",
name: "string",
onCallRoleId: "string",
roleId: "string",
});
type: rootly:ApiKey
properties:
description: string
expiresAt: string
gracePeriodEndsAt: string
kind: string
lastUsedAt: string
name: string
onCallRoleId: string
roleId: string
ApiKey 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 ApiKey resource accepts the following input properties:
- Expires
At string - Expiration date
- Description string
- A description of the API key
- Grace
Period stringEnds At - Grace period end date
- Kind string
- The kind of the API key. Value must be one of
personal,team,organization. - Last
Used stringAt - Date of last use
- Name string
- The name of the API key
- On
Call stringRole Id - The on-call role ID
- Role
Id string - The role ID
- Expires
At string - Expiration date
- Description string
- A description of the API key
- Grace
Period stringEnds At - Grace period end date
- Kind string
- The kind of the API key. Value must be one of
personal,team,organization. - Last
Used stringAt - Date of last use
- Name string
- The name of the API key
- On
Call stringRole Id - The on-call role ID
- Role
Id string - The role ID
- expires
At String - Expiration date
- description String
- A description of the API key
- grace
Period StringEnds At - Grace period end date
- kind String
- The kind of the API key. Value must be one of
personal,team,organization. - last
Used StringAt - Date of last use
- name String
- The name of the API key
- on
Call StringRole Id - The on-call role ID
- role
Id String - The role ID
- expires
At string - Expiration date
- description string
- A description of the API key
- grace
Period stringEnds At - Grace period end date
- kind string
- The kind of the API key. Value must be one of
personal,team,organization. - last
Used stringAt - Date of last use
- name string
- The name of the API key
- on
Call stringRole Id - The on-call role ID
- role
Id string - The role ID
- expires_
at str - Expiration date
- description str
- A description of the API key
- grace_
period_ strends_ at - Grace period end date
- kind str
- The kind of the API key. Value must be one of
personal,team,organization. - last_
used_ strat - Date of last use
- name str
- The name of the API key
- on_
call_ strrole_ id - The on-call role ID
- role_
id str - The role ID
- expires
At String - Expiration date
- description String
- A description of the API key
- grace
Period StringEnds At - Grace period end date
- kind String
- The kind of the API key. Value must be one of
personal,team,organization. - last
Used StringAt - Date of last use
- name String
- The name of the API key
- on
Call StringRole Id - The on-call role ID
- role
Id String - The role ID
Outputs
All input properties are implicitly available as output properties. Additionally, the ApiKey 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 ApiKey Resource
Get an existing ApiKey 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?: ApiKeyState, opts?: CustomResourceOptions): ApiKey@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
description: Optional[str] = None,
expires_at: Optional[str] = None,
grace_period_ends_at: Optional[str] = None,
kind: Optional[str] = None,
last_used_at: Optional[str] = None,
name: Optional[str] = None,
on_call_role_id: Optional[str] = None,
role_id: Optional[str] = None) -> ApiKeyfunc GetApiKey(ctx *Context, name string, id IDInput, state *ApiKeyState, opts ...ResourceOption) (*ApiKey, error)public static ApiKey Get(string name, Input<string> id, ApiKeyState? state, CustomResourceOptions? opts = null)public static ApiKey get(String name, Output<String> id, ApiKeyState state, CustomResourceOptions options)resources: _: type: rootly:ApiKey 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.
- Description string
- A description of the API key
- Expires
At string - Expiration date
- Grace
Period stringEnds At - Grace period end date
- Kind string
- The kind of the API key. Value must be one of
personal,team,organization. - Last
Used stringAt - Date of last use
- Name string
- The name of the API key
- On
Call stringRole Id - The on-call role ID
- Role
Id string - The role ID
- Description string
- A description of the API key
- Expires
At string - Expiration date
- Grace
Period stringEnds At - Grace period end date
- Kind string
- The kind of the API key. Value must be one of
personal,team,organization. - Last
Used stringAt - Date of last use
- Name string
- The name of the API key
- On
Call stringRole Id - The on-call role ID
- Role
Id string - The role ID
- description String
- A description of the API key
- expires
At String - Expiration date
- grace
Period StringEnds At - Grace period end date
- kind String
- The kind of the API key. Value must be one of
personal,team,organization. - last
Used StringAt - Date of last use
- name String
- The name of the API key
- on
Call StringRole Id - The on-call role ID
- role
Id String - The role ID
- description string
- A description of the API key
- expires
At string - Expiration date
- grace
Period stringEnds At - Grace period end date
- kind string
- The kind of the API key. Value must be one of
personal,team,organization. - last
Used stringAt - Date of last use
- name string
- The name of the API key
- on
Call stringRole Id - The on-call role ID
- role
Id string - The role ID
- description str
- A description of the API key
- expires_
at str - Expiration date
- grace_
period_ strends_ at - Grace period end date
- kind str
- The kind of the API key. Value must be one of
personal,team,organization. - last_
used_ strat - Date of last use
- name str
- The name of the API key
- on_
call_ strrole_ id - The on-call role ID
- role_
id str - The role ID
- description String
- A description of the API key
- expires
At String - Expiration date
- grace
Period StringEnds At - Grace period end date
- kind String
- The kind of the API key. Value must be one of
personal,team,organization. - last
Used StringAt - Date of last use
- name String
- The name of the API key
- on
Call StringRole Id - The on-call role ID
- role
Id String - The role ID
Import
rootly.ApiKey can be imported using the import command.
$ pulumi import rootly:index/apiKey:ApiKey primary a816421c-6ceb-481a-87c4-585e47451f24
Or using an import block.
Locate the resource id in the web app, or retrieve it by listing resources through the API if it’s not visible in the web app.
HCL can be generated from the import block using the -generate-config-out flag.
pulumi preview -generate-config-out=generated.tf
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- rootly rootlyhq/pulumi-rootly
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
rootlyTerraform Provider.
published on Thursday, May 7, 2026 by rootlyhq
