junipermist.org.Apitoken
Explore with Pulumi AI
This resource manages Org API Tokens. Org API token is a unique identifier used by an application to authenticate and access a service’s API. These tokens are used to authenticate requests made to the API server and ensure secure access to the API. They are not bound to any specific user and provide access to the organization as a whole. Organization tokens support different privileges and can only be used for the specific organization they are generated for. Rate limiting is done on an individual token basis, so if one token reaches its rate limit, it does not impact other tokens.
Example Usage
Coming soon!
Coming soon!
Coming soon!
Coming soon!
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.junipermist.org.Apitoken;
import com.pulumi.junipermist.org.ApitokenArgs;
import com.pulumi.junipermist.org.inputs.ApitokenPrivilegeArgs;
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 apitokenOne = new Apitoken("apitokenOne", ApitokenArgs.builder()
.orgId(terraformTest.id())
.name("apitoken_one")
.privileges(
ApitokenPrivilegeArgs.builder()
.scope("site")
.role("admin")
.site_id("d7c8364e-xxxx-xxxx-xxxx-37eff0475b03")
.build(),
ApitokenPrivilegeArgs.builder()
.scope("site")
.role("read")
.site_id("08f8851b-xxxx-xxxx-xxxx-9ebb5aa62de4")
.build())
.srcIps("1.2.3.4/32")
.build());
}
}
resources:
apitokenOne:
type: junipermist:org:Apitoken
name: apitoken_one
properties:
orgId: ${terraformTest.id}
name: apitoken_one
privileges:
- scope: site
role: admin
site_id: d7c8364e-xxxx-xxxx-xxxx-37eff0475b03
- scope: site
role: read
site_id: 08f8851b-xxxx-xxxx-xxxx-9ebb5aa62de4
srcIps:
- 1.2.3.4/32
Create Apitoken Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Apitoken(name: string, args: ApitokenArgs, opts?: CustomResourceOptions);
@overload
def Apitoken(resource_name: str,
args: ApitokenArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Apitoken(resource_name: str,
opts: Optional[ResourceOptions] = None,
org_id: Optional[str] = None,
privileges: Optional[Sequence[ApitokenPrivilegeArgs]] = None,
name: Optional[str] = None,
src_ips: Optional[Sequence[str]] = None)
func NewApitoken(ctx *Context, name string, args ApitokenArgs, opts ...ResourceOption) (*Apitoken, error)
public Apitoken(string name, ApitokenArgs args, CustomResourceOptions? opts = null)
public Apitoken(String name, ApitokenArgs args)
public Apitoken(String name, ApitokenArgs args, CustomResourceOptions options)
type: junipermist:org:Apitoken
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 ApitokenArgs
- 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 ApitokenArgs
- 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 ApitokenArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ApitokenArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ApitokenArgs
- 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 apitokenResource = new JuniperMist.Org.Apitoken("apitokenResource", new()
{
OrgId = "string",
Privileges = new[]
{
new JuniperMist.Org.Inputs.ApitokenPrivilegeArgs
{
Role = "string",
Scope = "string",
SiteId = "string",
SitegroupId = "string",
},
},
Name = "string",
SrcIps = new[]
{
"string",
},
});
example, err := org.NewApitoken(ctx, "apitokenResource", &org.ApitokenArgs{
OrgId: pulumi.String("string"),
Privileges: org.ApitokenPrivilegeArray{
&org.ApitokenPrivilegeArgs{
Role: pulumi.String("string"),
Scope: pulumi.String("string"),
SiteId: pulumi.String("string"),
SitegroupId: pulumi.String("string"),
},
},
Name: pulumi.String("string"),
SrcIps: pulumi.StringArray{
pulumi.String("string"),
},
})
var apitokenResource = new Apitoken("apitokenResource", ApitokenArgs.builder()
.orgId("string")
.privileges(ApitokenPrivilegeArgs.builder()
.role("string")
.scope("string")
.siteId("string")
.sitegroupId("string")
.build())
.name("string")
.srcIps("string")
.build());
apitoken_resource = junipermist.org.Apitoken("apitokenResource",
org_id="string",
privileges=[junipermist.org.ApitokenPrivilegeArgs(
role="string",
scope="string",
site_id="string",
sitegroup_id="string",
)],
name="string",
src_ips=["string"])
const apitokenResource = new junipermist.org.Apitoken("apitokenResource", {
orgId: "string",
privileges: [{
role: "string",
scope: "string",
siteId: "string",
sitegroupId: "string",
}],
name: "string",
srcIps: ["string"],
});
type: junipermist:org:Apitoken
properties:
name: string
orgId: string
privileges:
- role: string
scope: string
siteId: string
sitegroupId: string
srcIps:
- string
Apitoken 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 Apitoken resource accepts the following input properties:
- Org
Id string - Privileges
List<Pulumi.
Juniper Mist. Org. Inputs. Apitoken Privilege> - list of privileges the token has on the orgs/sites
- Name string
- name of the token
- Src
Ips List<string> - list of allowed IP addresses from where the token can be used from. At most 10 IP addresses can be specified, cannot be changed once the API Token is created.
- Org
Id string - Privileges
[]Apitoken
Privilege Args - list of privileges the token has on the orgs/sites
- Name string
- name of the token
- Src
Ips []string - list of allowed IP addresses from where the token can be used from. At most 10 IP addresses can be specified, cannot be changed once the API Token is created.
- org
Id String - privileges
List<Apitoken
Privilege> - list of privileges the token has on the orgs/sites
- name String
- name of the token
- src
Ips List<String> - list of allowed IP addresses from where the token can be used from. At most 10 IP addresses can be specified, cannot be changed once the API Token is created.
- org
Id string - privileges
Apitoken
Privilege[] - list of privileges the token has on the orgs/sites
- name string
- name of the token
- src
Ips string[] - list of allowed IP addresses from where the token can be used from. At most 10 IP addresses can be specified, cannot be changed once the API Token is created.
- org_
id str - privileges
Sequence[Apitoken
Privilege Args] - list of privileges the token has on the orgs/sites
- name str
- name of the token
- src_
ips Sequence[str] - list of allowed IP addresses from where the token can be used from. At most 10 IP addresses can be specified, cannot be changed once the API Token is created.
- org
Id String - privileges List<Property Map>
- list of privileges the token has on the orgs/sites
- name String
- name of the token
- src
Ips List<String> - list of allowed IP addresses from where the token can be used from. At most 10 IP addresses can be specified, cannot be changed once the API Token is created.
Outputs
All input properties are implicitly available as output properties. Additionally, the Apitoken resource produces the following output properties:
- created_
by str - email of the token creator / null if creator is deleted
- id str
- The provider-assigned unique ID for this managed resource.
- key str
Look up Existing Apitoken Resource
Get an existing Apitoken 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?: ApitokenState, opts?: CustomResourceOptions): Apitoken
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
created_by: Optional[str] = None,
key: Optional[str] = None,
name: Optional[str] = None,
org_id: Optional[str] = None,
privileges: Optional[Sequence[ApitokenPrivilegeArgs]] = None,
src_ips: Optional[Sequence[str]] = None) -> Apitoken
func GetApitoken(ctx *Context, name string, id IDInput, state *ApitokenState, opts ...ResourceOption) (*Apitoken, error)
public static Apitoken Get(string name, Input<string> id, ApitokenState? state, CustomResourceOptions? opts = null)
public static Apitoken get(String name, Output<String> id, ApitokenState 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
By string - email of the token creator / null if creator is deleted
- Key string
- Name string
- name of the token
- Org
Id string - Privileges
List<Pulumi.
Juniper Mist. Org. Inputs. Apitoken Privilege> - list of privileges the token has on the orgs/sites
- Src
Ips List<string> - list of allowed IP addresses from where the token can be used from. At most 10 IP addresses can be specified, cannot be changed once the API Token is created.
- Created
By string - email of the token creator / null if creator is deleted
- Key string
- Name string
- name of the token
- Org
Id string - Privileges
[]Apitoken
Privilege Args - list of privileges the token has on the orgs/sites
- Src
Ips []string - list of allowed IP addresses from where the token can be used from. At most 10 IP addresses can be specified, cannot be changed once the API Token is created.
- created
By String - email of the token creator / null if creator is deleted
- key String
- name String
- name of the token
- org
Id String - privileges
List<Apitoken
Privilege> - list of privileges the token has on the orgs/sites
- src
Ips List<String> - list of allowed IP addresses from where the token can be used from. At most 10 IP addresses can be specified, cannot be changed once the API Token is created.
- created
By string - email of the token creator / null if creator is deleted
- key string
- name string
- name of the token
- org
Id string - privileges
Apitoken
Privilege[] - list of privileges the token has on the orgs/sites
- src
Ips string[] - list of allowed IP addresses from where the token can be used from. At most 10 IP addresses can be specified, cannot be changed once the API Token is created.
- created_
by str - email of the token creator / null if creator is deleted
- key str
- name str
- name of the token
- org_
id str - privileges
Sequence[Apitoken
Privilege Args] - list of privileges the token has on the orgs/sites
- src_
ips Sequence[str] - list of allowed IP addresses from where the token can be used from. At most 10 IP addresses can be specified, cannot be changed once the API Token is created.
- created
By String - email of the token creator / null if creator is deleted
- key String
- name String
- name of the token
- org
Id String - privileges List<Property Map>
- list of privileges the token has on the orgs/sites
- src
Ips List<String> - list of allowed IP addresses from where the token can be used from. At most 10 IP addresses can be specified, cannot be changed once the API Token is created.
Supporting Types
ApitokenPrivilege, ApitokenPrivilegeArgs
- Role string
- access permissions. enum:
admin
,helpdesk
,installer
,read
,write
- Scope string
- enum:
org
,site
,sitegroup
- Site
Id string - Required if
scope
==site
- Sitegroup
Id string - Required if
scope
==sitegroup
- Role string
- access permissions. enum:
admin
,helpdesk
,installer
,read
,write
- Scope string
- enum:
org
,site
,sitegroup
- Site
Id string - Required if
scope
==site
- Sitegroup
Id string - Required if
scope
==sitegroup
- role String
- access permissions. enum:
admin
,helpdesk
,installer
,read
,write
- scope String
- enum:
org
,site
,sitegroup
- site
Id String - Required if
scope
==site
- sitegroup
Id String - Required if
scope
==sitegroup
- role string
- access permissions. enum:
admin
,helpdesk
,installer
,read
,write
- scope string
- enum:
org
,site
,sitegroup
- site
Id string - Required if
scope
==site
- sitegroup
Id string - Required if
scope
==sitegroup
- role str
- access permissions. enum:
admin
,helpdesk
,installer
,read
,write
- scope str
- enum:
org
,site
,sitegroup
- site_
id str - Required if
scope
==site
- sitegroup_
id str - Required if
scope
==sitegroup
- role String
- access permissions. enum:
admin
,helpdesk
,installer
,read
,write
- scope String
- enum:
org
,site
,sitegroup
- site
Id String - Required if
scope
==site
- sitegroup
Id String - Required if
scope
==sitegroup
Package Details
- Repository
- junipermist pulumi/pulumi-junipermist
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
mist
Terraform Provider.