newrelic.ApiAccessKey
Import
Existing API access keys can be imported using a composite ID of <api_access_key_id>:<key_type>, where <key_type> is either INGEST or USER. Refer to the considerations listed in the Important Considerations section above regarding limitations on importing the actual key value.
For example:
$ pulumi import newrelic:index/apiAccessKey:ApiAccessKey foobar "131313133A331313130B5F13DF01313FDB13B13133EE5E133D13EAAB3A3C13D3:INGEST"
For customers using Terraform v1.5 and above, it is recommended to use the import {} block in your Terraform configuration. This allows Terraform to generate the resource configuration automatically during the import process by running a pulumi preview -generate-config-out=<filename>.tf, reducing manual effort and ensuring accuracy.
For example:
hcl
import {
id = “131313133A331313130B5F13DF01313FDB13B13133EE5E133D13EAAB3A3C13D3:INGEST”
to = newrelic_api_access_key.foobar
}
This approach simplifies the import process and ensures that the resource configuration aligns with the imported state.
Create ApiAccessKey Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ApiAccessKey(name: string, args: ApiAccessKeyArgs, opts?: CustomResourceOptions);@overload
def ApiAccessKey(resource_name: str,
                 args: ApiAccessKeyArgs,
                 opts: Optional[ResourceOptions] = None)
@overload
def ApiAccessKey(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 key_type: Optional[str] = None,
                 account_id: Optional[str] = None,
                 ingest_type: Optional[str] = None,
                 name: Optional[str] = None,
                 notes: Optional[str] = None,
                 user_id: Optional[str] = None)func NewApiAccessKey(ctx *Context, name string, args ApiAccessKeyArgs, opts ...ResourceOption) (*ApiAccessKey, error)public ApiAccessKey(string name, ApiAccessKeyArgs args, CustomResourceOptions? opts = null)
public ApiAccessKey(String name, ApiAccessKeyArgs args)
public ApiAccessKey(String name, ApiAccessKeyArgs args, CustomResourceOptions options)
type: newrelic:ApiAccessKey
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 ApiAccessKeyArgs
- 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 ApiAccessKeyArgs
- 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 ApiAccessKeyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ApiAccessKeyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ApiAccessKeyArgs
- 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 apiAccessKeyResource = new NewRelic.ApiAccessKey("apiAccessKeyResource", new()
{
    KeyType = "string",
    AccountId = "string",
    IngestType = "string",
    Name = "string",
    Notes = "string",
    UserId = "string",
});
example, err := newrelic.NewApiAccessKey(ctx, "apiAccessKeyResource", &newrelic.ApiAccessKeyArgs{
	KeyType:    pulumi.String("string"),
	AccountId:  pulumi.String("string"),
	IngestType: pulumi.String("string"),
	Name:       pulumi.String("string"),
	Notes:      pulumi.String("string"),
	UserId:     pulumi.String("string"),
})
var apiAccessKeyResource = new ApiAccessKey("apiAccessKeyResource", ApiAccessKeyArgs.builder()
    .keyType("string")
    .accountId("string")
    .ingestType("string")
    .name("string")
    .notes("string")
    .userId("string")
    .build());
api_access_key_resource = newrelic.ApiAccessKey("apiAccessKeyResource",
    key_type="string",
    account_id="string",
    ingest_type="string",
    name="string",
    notes="string",
    user_id="string")
const apiAccessKeyResource = new newrelic.ApiAccessKey("apiAccessKeyResource", {
    keyType: "string",
    accountId: "string",
    ingestType: "string",
    name: "string",
    notes: "string",
    userId: "string",
});
type: newrelic:ApiAccessKey
properties:
    accountId: string
    ingestType: string
    keyType: string
    name: string
    notes: string
    userId: string
ApiAccessKey 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 ApiAccessKey resource accepts the following input properties:
- KeyType string
- The type of API key to create. Valid options are INGESTorUSER(case-sensitive).- If key_typeisINGEST, theningest_typemust be specified.
- If key_typeisUSER, thenuser_idmust be specified.
 
- If 
- AccountId string
- The New Relic account ID where the API access key will be created.
- IngestType string
- Required if key_typeisINGEST. Valid options areBROWSERorLICENSE(case-sensitive).
- Name string
- Notes string
- Additional notes about the API access key.
- UserId string
- Required if key_typeisUSER. The New Relic user ID for which the API access key will be created.
- KeyType string
- The type of API key to create. Valid options are INGESTorUSER(case-sensitive).- If key_typeisINGEST, theningest_typemust be specified.
- If key_typeisUSER, thenuser_idmust be specified.
 
- If 
- AccountId string
- The New Relic account ID where the API access key will be created.
- IngestType string
- Required if key_typeisINGEST. Valid options areBROWSERorLICENSE(case-sensitive).
- Name string
- Notes string
- Additional notes about the API access key.
- UserId string
- Required if key_typeisUSER. The New Relic user ID for which the API access key will be created.
- keyType String
- The type of API key to create. Valid options are INGESTorUSER(case-sensitive).- If key_typeisINGEST, theningest_typemust be specified.
- If key_typeisUSER, thenuser_idmust be specified.
 
- If 
- accountId String
- The New Relic account ID where the API access key will be created.
- ingestType String
- Required if key_typeisINGEST. Valid options areBROWSERorLICENSE(case-sensitive).
- name String
- notes String
- Additional notes about the API access key.
- userId String
- Required if key_typeisUSER. The New Relic user ID for which the API access key will be created.
- keyType string
- The type of API key to create. Valid options are INGESTorUSER(case-sensitive).- If key_typeisINGEST, theningest_typemust be specified.
- If key_typeisUSER, thenuser_idmust be specified.
 
- If 
- accountId string
- The New Relic account ID where the API access key will be created.
- ingestType string
- Required if key_typeisINGEST. Valid options areBROWSERorLICENSE(case-sensitive).
- name string
- notes string
- Additional notes about the API access key.
- userId string
- Required if key_typeisUSER. The New Relic user ID for which the API access key will be created.
- key_type str
- The type of API key to create. Valid options are INGESTorUSER(case-sensitive).- If key_typeisINGEST, theningest_typemust be specified.
- If key_typeisUSER, thenuser_idmust be specified.
 
- If 
- account_id str
- The New Relic account ID where the API access key will be created.
- ingest_type str
- Required if key_typeisINGEST. Valid options areBROWSERorLICENSE(case-sensitive).
- name str
- notes str
- Additional notes about the API access key.
- user_id str
- Required if key_typeisUSER. The New Relic user ID for which the API access key will be created.
- keyType String
- The type of API key to create. Valid options are INGESTorUSER(case-sensitive).- If key_typeisINGEST, theningest_typemust be specified.
- If key_typeisUSER, thenuser_idmust be specified.
 
- If 
- accountId String
- The New Relic account ID where the API access key will be created.
- ingestType String
- Required if key_typeisINGEST. Valid options areBROWSERorLICENSE(case-sensitive).
- name String
- notes String
- Additional notes about the API access key.
- userId String
- Required if key_typeisUSER. The New Relic user ID for which the API access key will be created.
Outputs
All input properties are implicitly available as output properties. Additionally, the ApiAccessKey resource produces the following output properties:
Look up Existing ApiAccessKey Resource
Get an existing ApiAccessKey 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?: ApiAccessKeyState, opts?: CustomResourceOptions): ApiAccessKey@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        account_id: Optional[str] = None,
        ingest_type: Optional[str] = None,
        key: Optional[str] = None,
        key_type: Optional[str] = None,
        name: Optional[str] = None,
        notes: Optional[str] = None,
        user_id: Optional[str] = None) -> ApiAccessKeyfunc GetApiAccessKey(ctx *Context, name string, id IDInput, state *ApiAccessKeyState, opts ...ResourceOption) (*ApiAccessKey, error)public static ApiAccessKey Get(string name, Input<string> id, ApiAccessKeyState? state, CustomResourceOptions? opts = null)public static ApiAccessKey get(String name, Output<String> id, ApiAccessKeyState state, CustomResourceOptions options)resources:  _:    type: newrelic:ApiAccessKey    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.
- AccountId string
- The New Relic account ID where the API access key will be created.
- IngestType string
- Required if key_typeisINGEST. Valid options areBROWSERorLICENSE(case-sensitive).
- Key string
- The actual API key.- It is important to exercise caution when exporting the value of key, as it is sensitive information. Avoid logging or exposing it inappropriately.
 
- It is important to exercise caution when exporting the value of 
- KeyType string
- The type of API key to create. Valid options are INGESTorUSER(case-sensitive).- If key_typeisINGEST, theningest_typemust be specified.
- If key_typeisUSER, thenuser_idmust be specified.
 
- If 
- Name string
- Notes string
- Additional notes about the API access key.
- UserId string
- Required if key_typeisUSER. The New Relic user ID for which the API access key will be created.
- AccountId string
- The New Relic account ID where the API access key will be created.
- IngestType string
- Required if key_typeisINGEST. Valid options areBROWSERorLICENSE(case-sensitive).
- Key string
- The actual API key.- It is important to exercise caution when exporting the value of key, as it is sensitive information. Avoid logging or exposing it inappropriately.
 
- It is important to exercise caution when exporting the value of 
- KeyType string
- The type of API key to create. Valid options are INGESTorUSER(case-sensitive).- If key_typeisINGEST, theningest_typemust be specified.
- If key_typeisUSER, thenuser_idmust be specified.
 
- If 
- Name string
- Notes string
- Additional notes about the API access key.
- UserId string
- Required if key_typeisUSER. The New Relic user ID for which the API access key will be created.
- accountId String
- The New Relic account ID where the API access key will be created.
- ingestType String
- Required if key_typeisINGEST. Valid options areBROWSERorLICENSE(case-sensitive).
- key String
- The actual API key.- It is important to exercise caution when exporting the value of key, as it is sensitive information. Avoid logging or exposing it inappropriately.
 
- It is important to exercise caution when exporting the value of 
- keyType String
- The type of API key to create. Valid options are INGESTorUSER(case-sensitive).- If key_typeisINGEST, theningest_typemust be specified.
- If key_typeisUSER, thenuser_idmust be specified.
 
- If 
- name String
- notes String
- Additional notes about the API access key.
- userId String
- Required if key_typeisUSER. The New Relic user ID for which the API access key will be created.
- accountId string
- The New Relic account ID where the API access key will be created.
- ingestType string
- Required if key_typeisINGEST. Valid options areBROWSERorLICENSE(case-sensitive).
- key string
- The actual API key.- It is important to exercise caution when exporting the value of key, as it is sensitive information. Avoid logging or exposing it inappropriately.
 
- It is important to exercise caution when exporting the value of 
- keyType string
- The type of API key to create. Valid options are INGESTorUSER(case-sensitive).- If key_typeisINGEST, theningest_typemust be specified.
- If key_typeisUSER, thenuser_idmust be specified.
 
- If 
- name string
- notes string
- Additional notes about the API access key.
- userId string
- Required if key_typeisUSER. The New Relic user ID for which the API access key will be created.
- account_id str
- The New Relic account ID where the API access key will be created.
- ingest_type str
- Required if key_typeisINGEST. Valid options areBROWSERorLICENSE(case-sensitive).
- key str
- The actual API key.- It is important to exercise caution when exporting the value of key, as it is sensitive information. Avoid logging or exposing it inappropriately.
 
- It is important to exercise caution when exporting the value of 
- key_type str
- The type of API key to create. Valid options are INGESTorUSER(case-sensitive).- If key_typeisINGEST, theningest_typemust be specified.
- If key_typeisUSER, thenuser_idmust be specified.
 
- If 
- name str
- notes str
- Additional notes about the API access key.
- user_id str
- Required if key_typeisUSER. The New Relic user ID for which the API access key will be created.
- accountId String
- The New Relic account ID where the API access key will be created.
- ingestType String
- Required if key_typeisINGEST. Valid options areBROWSERorLICENSE(case-sensitive).
- key String
- The actual API key.- It is important to exercise caution when exporting the value of key, as it is sensitive information. Avoid logging or exposing it inappropriately.
 
- It is important to exercise caution when exporting the value of 
- keyType String
- The type of API key to create. Valid options are INGESTorUSER(case-sensitive).- If key_typeisINGEST, theningest_typemust be specified.
- If key_typeisUSER, thenuser_idmust be specified.
 
- If 
- name String
- notes String
- Additional notes about the API access key.
- userId String
- Required if key_typeisUSER. The New Relic user ID for which the API access key will be created.
Package Details
- Repository
- New Relic pulumi/pulumi-newrelic
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the newrelicTerraform Provider.
