ibm.IamServiceApiKey
Explore with Pulumi AI
Create, update, or delete an IAM service API key by using resource group and resource type.For more information, about IAM service API key, see managing IAM acces, API keys.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as ibm from "@pulumi/ibm";
const serviceID = new ibm.IamServiceId("serviceID", {});
const testaccApiKey = new ibm.IamServiceApiKey("testaccApiKey", {iamServiceId: serviceID.iamId});
import pulumi
import pulumi_ibm as ibm
service_id = ibm.IamServiceId("serviceID")
testacc_api_key = ibm.IamServiceApiKey("testaccApiKey", iam_service_id=service_id.iam_id)
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/ibm/ibm"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
serviceID, err := ibm.NewIamServiceId(ctx, "serviceID", nil)
if err != nil {
return err
}
_, err = ibm.NewIamServiceApiKey(ctx, "testaccApiKey", &ibm.IamServiceApiKeyArgs{
IamServiceId: serviceID.IamId,
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ibm = Pulumi.Ibm;
return await Deployment.RunAsync(() =>
{
var serviceID = new Ibm.IamServiceId("serviceID");
var testaccApiKey = new Ibm.IamServiceApiKey("testaccApiKey", new()
{
IamServiceId = serviceID.IamId,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ibm.IamServiceId;
import com.pulumi.ibm.IamServiceApiKey;
import com.pulumi.ibm.IamServiceApiKeyArgs;
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 serviceID = new IamServiceId("serviceID");
var testaccApiKey = new IamServiceApiKey("testaccApiKey", IamServiceApiKeyArgs.builder()
.iamServiceId(serviceID.iamId())
.build());
}
}
resources:
serviceID:
type: ibm:IamServiceId
testaccApiKey:
type: ibm:IamServiceApiKey
properties:
iamServiceId: ${serviceID.iamId}
Create IamServiceApiKey Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new IamServiceApiKey(name: string, args: IamServiceApiKeyArgs, opts?: CustomResourceOptions);
@overload
def IamServiceApiKey(resource_name: str,
args: IamServiceApiKeyArgs,
opts: Optional[ResourceOptions] = None)
@overload
def IamServiceApiKey(resource_name: str,
opts: Optional[ResourceOptions] = None,
iam_service_id: Optional[str] = None,
apikey: Optional[str] = None,
description: Optional[str] = None,
file: Optional[str] = None,
iam_service_api_key_id: Optional[str] = None,
locked: Optional[bool] = None,
name: Optional[str] = None,
store_value: Optional[bool] = None)
func NewIamServiceApiKey(ctx *Context, name string, args IamServiceApiKeyArgs, opts ...ResourceOption) (*IamServiceApiKey, error)
public IamServiceApiKey(string name, IamServiceApiKeyArgs args, CustomResourceOptions? opts = null)
public IamServiceApiKey(String name, IamServiceApiKeyArgs args)
public IamServiceApiKey(String name, IamServiceApiKeyArgs args, CustomResourceOptions options)
type: ibm:IamServiceApiKey
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 IamServiceApiKeyArgs
- 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 IamServiceApiKeyArgs
- 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 IamServiceApiKeyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args IamServiceApiKeyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args IamServiceApiKeyArgs
- 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 iamServiceApiKeyResource = new Ibm.IamServiceApiKey("iamServiceApiKeyResource", new()
{
IamServiceId = "string",
Apikey = "string",
Description = "string",
File = "string",
IamServiceApiKeyId = "string",
Locked = false,
Name = "string",
StoreValue = false,
});
example, err := ibm.NewIamServiceApiKey(ctx, "iamServiceApiKeyResource", &ibm.IamServiceApiKeyArgs{
IamServiceId: pulumi.String("string"),
Apikey: pulumi.String("string"),
Description: pulumi.String("string"),
File: pulumi.String("string"),
IamServiceApiKeyId: pulumi.String("string"),
Locked: pulumi.Bool(false),
Name: pulumi.String("string"),
StoreValue: pulumi.Bool(false),
})
var iamServiceApiKeyResource = new IamServiceApiKey("iamServiceApiKeyResource", IamServiceApiKeyArgs.builder()
.iamServiceId("string")
.apikey("string")
.description("string")
.file("string")
.iamServiceApiKeyId("string")
.locked(false)
.name("string")
.storeValue(false)
.build());
iam_service_api_key_resource = ibm.IamServiceApiKey("iamServiceApiKeyResource",
iam_service_id="string",
apikey="string",
description="string",
file="string",
iam_service_api_key_id="string",
locked=False,
name="string",
store_value=False)
const iamServiceApiKeyResource = new ibm.IamServiceApiKey("iamServiceApiKeyResource", {
iamServiceId: "string",
apikey: "string",
description: "string",
file: "string",
iamServiceApiKeyId: "string",
locked: false,
name: "string",
storeValue: false,
});
type: ibm:IamServiceApiKey
properties:
apikey: string
description: string
file: string
iamServiceApiKeyId: string
iamServiceId: string
locked: false
name: string
storeValue: false
IamServiceApiKey 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 IamServiceApiKey resource accepts the following input properties:
- Iam
Service stringId - The IAM ID of the service.
- Apikey string
- The API key value. This property only contains the API key value for the following cases:
create an API key
,update a Service API key that stores the API key value as retrievable
, orget a service API key that stores the API key value as retrievable
. All other operations do not return the API key value. For example, all user API key related operations, except for create, do not contain the API key value. - Description string
- The description of the service API key.
- File string
- The file name where API key is to be stored.
- Iam
Service stringApi Key Id - (String) The unique identifier of the API key.
- Locked bool
- The API key cannot be changed if set to true.
- Name string
- The name of the service API key.
- Store
Value bool - The boolean value whether API key value is retrievable in the future.
- Iam
Service stringId - The IAM ID of the service.
- Apikey string
- The API key value. This property only contains the API key value for the following cases:
create an API key
,update a Service API key that stores the API key value as retrievable
, orget a service API key that stores the API key value as retrievable
. All other operations do not return the API key value. For example, all user API key related operations, except for create, do not contain the API key value. - Description string
- The description of the service API key.
- File string
- The file name where API key is to be stored.
- Iam
Service stringApi Key Id - (String) The unique identifier of the API key.
- Locked bool
- The API key cannot be changed if set to true.
- Name string
- The name of the service API key.
- Store
Value bool - The boolean value whether API key value is retrievable in the future.
- iam
Service StringId - The IAM ID of the service.
- apikey String
- The API key value. This property only contains the API key value for the following cases:
create an API key
,update a Service API key that stores the API key value as retrievable
, orget a service API key that stores the API key value as retrievable
. All other operations do not return the API key value. For example, all user API key related operations, except for create, do not contain the API key value. - description String
- The description of the service API key.
- file String
- The file name where API key is to be stored.
- iam
Service StringApi Key Id - (String) The unique identifier of the API key.
- locked Boolean
- The API key cannot be changed if set to true.
- name String
- The name of the service API key.
- store
Value Boolean - The boolean value whether API key value is retrievable in the future.
- iam
Service stringId - The IAM ID of the service.
- apikey string
- The API key value. This property only contains the API key value for the following cases:
create an API key
,update a Service API key that stores the API key value as retrievable
, orget a service API key that stores the API key value as retrievable
. All other operations do not return the API key value. For example, all user API key related operations, except for create, do not contain the API key value. - description string
- The description of the service API key.
- file string
- The file name where API key is to be stored.
- iam
Service stringApi Key Id - (String) The unique identifier of the API key.
- locked boolean
- The API key cannot be changed if set to true.
- name string
- The name of the service API key.
- store
Value boolean - The boolean value whether API key value is retrievable in the future.
- iam_
service_ strid - The IAM ID of the service.
- apikey str
- The API key value. This property only contains the API key value for the following cases:
create an API key
,update a Service API key that stores the API key value as retrievable
, orget a service API key that stores the API key value as retrievable
. All other operations do not return the API key value. For example, all user API key related operations, except for create, do not contain the API key value. - description str
- The description of the service API key.
- file str
- The file name where API key is to be stored.
- iam_
service_ strapi_ key_ id - (String) The unique identifier of the API key.
- locked bool
- The API key cannot be changed if set to true.
- name str
- The name of the service API key.
- store_
value bool - The boolean value whether API key value is retrievable in the future.
- iam
Service StringId - The IAM ID of the service.
- apikey String
- The API key value. This property only contains the API key value for the following cases:
create an API key
,update a Service API key that stores the API key value as retrievable
, orget a service API key that stores the API key value as retrievable
. All other operations do not return the API key value. For example, all user API key related operations, except for create, do not contain the API key value. - description String
- The description of the service API key.
- file String
- The file name where API key is to be stored.
- iam
Service StringApi Key Id - (String) The unique identifier of the API key.
- locked Boolean
- The API key cannot be changed if set to true.
- name String
- The name of the service API key.
- store
Value Boolean - The boolean value whether API key value is retrievable in the future.
Outputs
All input properties are implicitly available as output properties. Additionally, the IamServiceApiKey resource produces the following output properties:
- Account
Id string - (String) The account Id of the API key.
entity_tag
- (String) The version or entity tag of the service API key.
- Created
At string - (Timestamp) The date and time service API key was created.
- Created
By string - (String) The IAM ID of the service that is created by the API key.
- Crn string
- (String) The
CRN
of the service API key. - Entity
Tag string - Version of the API Key details object
- Id string
- The provider-assigned unique ID for this managed resource.
- Modified
At string - (String) The date and time service API key was modified.
- Account
Id string - (String) The account Id of the API key.
entity_tag
- (String) The version or entity tag of the service API key.
- Created
At string - (Timestamp) The date and time service API key was created.
- Created
By string - (String) The IAM ID of the service that is created by the API key.
- Crn string
- (String) The
CRN
of the service API key. - Entity
Tag string - Version of the API Key details object
- Id string
- The provider-assigned unique ID for this managed resource.
- Modified
At string - (String) The date and time service API key was modified.
- account
Id String - (String) The account Id of the API key.
entity_tag
- (String) The version or entity tag of the service API key.
- created
At String - (Timestamp) The date and time service API key was created.
- created
By String - (String) The IAM ID of the service that is created by the API key.
- crn String
- (String) The
CRN
of the service API key. - entity
Tag String - Version of the API Key details object
- id String
- The provider-assigned unique ID for this managed resource.
- modified
At String - (String) The date and time service API key was modified.
- account
Id string - (String) The account Id of the API key.
entity_tag
- (String) The version or entity tag of the service API key.
- created
At string - (Timestamp) The date and time service API key was created.
- created
By string - (String) The IAM ID of the service that is created by the API key.
- crn string
- (String) The
CRN
of the service API key. - entity
Tag string - Version of the API Key details object
- id string
- The provider-assigned unique ID for this managed resource.
- modified
At string - (String) The date and time service API key was modified.
- account_
id str - (String) The account Id of the API key.
entity_tag
- (String) The version or entity tag of the service API key.
- created_
at str - (Timestamp) The date and time service API key was created.
- created_
by str - (String) The IAM ID of the service that is created by the API key.
- crn str
- (String) The
CRN
of the service API key. - entity_
tag str - Version of the API Key details object
- id str
- The provider-assigned unique ID for this managed resource.
- modified_
at str - (String) The date and time service API key was modified.
- account
Id String - (String) The account Id of the API key.
entity_tag
- (String) The version or entity tag of the service API key.
- created
At String - (Timestamp) The date and time service API key was created.
- created
By String - (String) The IAM ID of the service that is created by the API key.
- crn String
- (String) The
CRN
of the service API key. - entity
Tag String - Version of the API Key details object
- id String
- The provider-assigned unique ID for this managed resource.
- modified
At String - (String) The date and time service API key was modified.
Look up Existing IamServiceApiKey Resource
Get an existing IamServiceApiKey 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?: IamServiceApiKeyState, opts?: CustomResourceOptions): IamServiceApiKey
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
account_id: Optional[str] = None,
apikey: Optional[str] = None,
created_at: Optional[str] = None,
created_by: Optional[str] = None,
crn: Optional[str] = None,
description: Optional[str] = None,
entity_tag: Optional[str] = None,
file: Optional[str] = None,
iam_service_api_key_id: Optional[str] = None,
iam_service_id: Optional[str] = None,
locked: Optional[bool] = None,
modified_at: Optional[str] = None,
name: Optional[str] = None,
store_value: Optional[bool] = None) -> IamServiceApiKey
func GetIamServiceApiKey(ctx *Context, name string, id IDInput, state *IamServiceApiKeyState, opts ...ResourceOption) (*IamServiceApiKey, error)
public static IamServiceApiKey Get(string name, Input<string> id, IamServiceApiKeyState? state, CustomResourceOptions? opts = null)
public static IamServiceApiKey get(String name, Output<String> id, IamServiceApiKeyState state, CustomResourceOptions options)
resources: _: type: ibm:IamServiceApiKey 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.
- Account
Id string - (String) The account Id of the API key.
entity_tag
- (String) The version or entity tag of the service API key.
- Apikey string
- The API key value. This property only contains the API key value for the following cases:
create an API key
,update a Service API key that stores the API key value as retrievable
, orget a service API key that stores the API key value as retrievable
. All other operations do not return the API key value. For example, all user API key related operations, except for create, do not contain the API key value. - Created
At string - (Timestamp) The date and time service API key was created.
- Created
By string - (String) The IAM ID of the service that is created by the API key.
- Crn string
- (String) The
CRN
of the service API key. - Description string
- The description of the service API key.
- Entity
Tag string - Version of the API Key details object
- File string
- The file name where API key is to be stored.
- Iam
Service stringApi Key Id - (String) The unique identifier of the API key.
- Iam
Service stringId - The IAM ID of the service.
- Locked bool
- The API key cannot be changed if set to true.
- Modified
At string - (String) The date and time service API key was modified.
- Name string
- The name of the service API key.
- Store
Value bool - The boolean value whether API key value is retrievable in the future.
- Account
Id string - (String) The account Id of the API key.
entity_tag
- (String) The version or entity tag of the service API key.
- Apikey string
- The API key value. This property only contains the API key value for the following cases:
create an API key
,update a Service API key that stores the API key value as retrievable
, orget a service API key that stores the API key value as retrievable
. All other operations do not return the API key value. For example, all user API key related operations, except for create, do not contain the API key value. - Created
At string - (Timestamp) The date and time service API key was created.
- Created
By string - (String) The IAM ID of the service that is created by the API key.
- Crn string
- (String) The
CRN
of the service API key. - Description string
- The description of the service API key.
- Entity
Tag string - Version of the API Key details object
- File string
- The file name where API key is to be stored.
- Iam
Service stringApi Key Id - (String) The unique identifier of the API key.
- Iam
Service stringId - The IAM ID of the service.
- Locked bool
- The API key cannot be changed if set to true.
- Modified
At string - (String) The date and time service API key was modified.
- Name string
- The name of the service API key.
- Store
Value bool - The boolean value whether API key value is retrievable in the future.
- account
Id String - (String) The account Id of the API key.
entity_tag
- (String) The version or entity tag of the service API key.
- apikey String
- The API key value. This property only contains the API key value for the following cases:
create an API key
,update a Service API key that stores the API key value as retrievable
, orget a service API key that stores the API key value as retrievable
. All other operations do not return the API key value. For example, all user API key related operations, except for create, do not contain the API key value. - created
At String - (Timestamp) The date and time service API key was created.
- created
By String - (String) The IAM ID of the service that is created by the API key.
- crn String
- (String) The
CRN
of the service API key. - description String
- The description of the service API key.
- entity
Tag String - Version of the API Key details object
- file String
- The file name where API key is to be stored.
- iam
Service StringApi Key Id - (String) The unique identifier of the API key.
- iam
Service StringId - The IAM ID of the service.
- locked Boolean
- The API key cannot be changed if set to true.
- modified
At String - (String) The date and time service API key was modified.
- name String
- The name of the service API key.
- store
Value Boolean - The boolean value whether API key value is retrievable in the future.
- account
Id string - (String) The account Id of the API key.
entity_tag
- (String) The version or entity tag of the service API key.
- apikey string
- The API key value. This property only contains the API key value for the following cases:
create an API key
,update a Service API key that stores the API key value as retrievable
, orget a service API key that stores the API key value as retrievable
. All other operations do not return the API key value. For example, all user API key related operations, except for create, do not contain the API key value. - created
At string - (Timestamp) The date and time service API key was created.
- created
By string - (String) The IAM ID of the service that is created by the API key.
- crn string
- (String) The
CRN
of the service API key. - description string
- The description of the service API key.
- entity
Tag string - Version of the API Key details object
- file string
- The file name where API key is to be stored.
- iam
Service stringApi Key Id - (String) The unique identifier of the API key.
- iam
Service stringId - The IAM ID of the service.
- locked boolean
- The API key cannot be changed if set to true.
- modified
At string - (String) The date and time service API key was modified.
- name string
- The name of the service API key.
- store
Value boolean - The boolean value whether API key value is retrievable in the future.
- account_
id str - (String) The account Id of the API key.
entity_tag
- (String) The version or entity tag of the service API key.
- apikey str
- The API key value. This property only contains the API key value for the following cases:
create an API key
,update a Service API key that stores the API key value as retrievable
, orget a service API key that stores the API key value as retrievable
. All other operations do not return the API key value. For example, all user API key related operations, except for create, do not contain the API key value. - created_
at str - (Timestamp) The date and time service API key was created.
- created_
by str - (String) The IAM ID of the service that is created by the API key.
- crn str
- (String) The
CRN
of the service API key. - description str
- The description of the service API key.
- entity_
tag str - Version of the API Key details object
- file str
- The file name where API key is to be stored.
- iam_
service_ strapi_ key_ id - (String) The unique identifier of the API key.
- iam_
service_ strid - The IAM ID of the service.
- locked bool
- The API key cannot be changed if set to true.
- modified_
at str - (String) The date and time service API key was modified.
- name str
- The name of the service API key.
- store_
value bool - The boolean value whether API key value is retrievable in the future.
- account
Id String - (String) The account Id of the API key.
entity_tag
- (String) The version or entity tag of the service API key.
- apikey String
- The API key value. This property only contains the API key value for the following cases:
create an API key
,update a Service API key that stores the API key value as retrievable
, orget a service API key that stores the API key value as retrievable
. All other operations do not return the API key value. For example, all user API key related operations, except for create, do not contain the API key value. - created
At String - (Timestamp) The date and time service API key was created.
- created
By String - (String) The IAM ID of the service that is created by the API key.
- crn String
- (String) The
CRN
of the service API key. - description String
- The description of the service API key.
- entity
Tag String - Version of the API Key details object
- file String
- The file name where API key is to be stored.
- iam
Service StringApi Key Id - (String) The unique identifier of the API key.
- iam
Service StringId - The IAM ID of the service.
- locked Boolean
- The API key cannot be changed if set to true.
- modified
At String - (String) The date and time service API key was modified.
- name String
- The name of the service API key.
- store
Value Boolean - The boolean value whether API key value is retrievable in the future.
Import
The ibm_iam_service_api_key
resource can be imported by using service API Key.
Syntax
$ pulumi import ibm:index/iamServiceApiKey:IamServiceApiKey testacc_apiKey <service API key>
Example
$ pulumi import ibm:index/iamServiceApiKey:IamServiceApiKey testacc_apiKey ApiKey-9d12342134f-41c2-a541-7b0be37c3da0
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- ibm ibm-cloud/terraform-provider-ibm
- License
- Notes
- This Pulumi package is based on the
ibm
Terraform Provider.