Skip to content

Commit a4d88b5

Browse files
committed
PLT-1519:Added support for resource limits.
1 parent 28d2c68 commit a4d88b5

File tree

9 files changed

+434
-27
lines changed

9 files changed

+434
-27
lines changed

docs/resources/resource_limit.md

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
---
2+
page_title: "spectrocloud_resource_limit Resource - terraform-provider-spectrocloud"
3+
subcategory: ""
4+
description: |-
5+
6+
---
7+
8+
# spectrocloud_resource_limit (Resource)
9+
10+
11+
12+
You can learn more about managing resource limit in Palette by reviewing the [Default Resource Limit](https://docs.spectrocloud.com/tenant-settings/palette-resource-limits/?utm_source=palette&utm_medium=product2docs) guide.
13+
14+
~> The resource_limit resource enforces a resource limit in Palette. By default, a resource limit is configured in Palette with default values. Users can update the resource limit settings as per their requirements. When a spectrocloud_resource_limit resource is destroyed, the resource limits will revert to the Palette default settings.
15+
16+
## Example Usage
17+
18+
An example of managing an password policy in Palette.
19+
20+
```hcl
21+
resource "spectrocloud_resource_limit" "resource_limit" {
22+
alert = 101
23+
api_keys = 201
24+
appliance = 6001
25+
appliance_token = 201
26+
application_deployment = 200
27+
application_profile = 200
28+
certificate = 20
29+
cloud_account = 355
30+
cluster = 300
31+
cluster_group = 50
32+
cluster_profile = 2500
33+
filter = 200
34+
location = 100
35+
macro = 6000
36+
private_gateway = 100
37+
project = 200
38+
registry = 200
39+
role = 100
40+
ssh_key = 300
41+
team = 100
42+
user = 300
43+
workspace = 60
44+
}
45+
46+
## import existing resource limit
47+
#import {
48+
# to = spectrocloud_resource_limit.resource_limit
49+
# id = "5eea74e919f5e0d43fd3f316" // tenant-uid
50+
#}
51+
```
52+
53+
<!-- schema generated by tfplugindocs -->
54+
## Schema
55+
56+
### Optional
57+
58+
- `alert` (Number) The maximum number of alerts that can be created. Must be between 1 and 10,000.
59+
- `api_keys` (Number) The maximum number of API keys that can be generated. Must be between 1 and 10,000.
60+
- `appliance` (Number) The maximum number of appliances that can be managed. Must be between 1 and 50,000.
61+
- `appliance_token` (Number) The maximum number of appliance tokens that can be issued. Must be between 1 and 10,000.
62+
- `application_deployment` (Number) The maximum number of application deployments allowed. Must be between 1 and 10,000.
63+
- `application_profile` (Number) The maximum number of application profiles that can be configured. Must be between 1 and 10,000.
64+
- `certificate` (Number) The maximum number of certificates that can be managed. Must be between 1 and 10,000.
65+
- `cloud_account` (Number) The maximum number of cloud accounts that can be added. Must be between 1 and 10,000.
66+
- `cluster` (Number) The maximum number of clusters that can be created. Must be between 1 and 50,000.
67+
- `cluster_group` (Number) The maximum number of cluster groups that can be created. Must be between 1 and 10,000.
68+
- `cluster_profile` (Number) The maximum number of cluster profiles that can be configured. Must be between 1 and 10,000.
69+
- `filter` (Number) The maximum number of filters that can be defined. Must be between 1 and 10,000.
70+
- `location` (Number) The maximum number of locations that can be configured. Must be between 1 and 10,000.
71+
- `macro` (Number) The maximum number of macros that can be created. Must be between 1 and 10,000.
72+
- `private_gateway` (Number) The maximum number of private gateways that can be managed. Must be between 1 and 10,000.
73+
- `project` (Number) The maximum number of projects that can be created. Must be between 1 and 10,000.
74+
- `registry` (Number) The maximum number of registries that can be configured. Must be between 1 and 10,000.
75+
- `role` (Number) The maximum number of roles that can be assigned. Must be between 1 and 10,000.
76+
- `ssh_key` (Number) The maximum number of SSH keys that can be managed. Must be between 1 and 10,000.
77+
- `team` (Number) The maximum number of teams that can be created. Must be between 1 and 10,000.
78+
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))
79+
- `user` (Number) The maximum number of users that can be added. Must be between 1 and 10,000.
80+
- `workspace` (Number) The maximum number of workspaces that can be created. Must be between 1 and 10,000.
81+
82+
### Read-Only
83+
84+
- `id` (String) The ID of this resource.
85+
86+
<a id="nestedblock--timeouts"></a>
87+
### Nested Schema for `timeouts`
88+
89+
Optional:
90+
91+
- `create` (String)
92+
- `delete` (String)
93+
- `update` (String)
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
terraform {
2+
required_providers {
3+
spectrocloud = {
4+
version = ">= 0.1"
5+
source = "spectrocloud/spectrocloud"
6+
}
7+
}
8+
}
9+
10+
provider "spectrocloud" {
11+
host = var.sc_host
12+
api_key = var.sc_api_key
13+
project_name = var.sc_project_name
14+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
resource "spectrocloud_resource_limit" "resource_limit" {
2+
alert = 101
3+
api_keys = 201
4+
appliance = 6001
5+
appliance_token = 201
6+
application_deployment = 200
7+
application_profile = 200
8+
certificate = 20
9+
cloud_account = 355
10+
cluster = 300
11+
cluster_group = 50
12+
cluster_profile = 2500
13+
filter = 200
14+
location = 100
15+
macro = 6000
16+
private_gateway = 100
17+
project = 200
18+
registry = 200
19+
role = 100
20+
ssh_key = 300
21+
team = 100
22+
user = 300
23+
workspace = 60
24+
}
25+
26+
## import existing resource limit
27+
#import {
28+
# to = spectrocloud_resource_limit.resource_limit
29+
# id = "5eea74e919f5e0d43fd3f316" // tenant-uid
30+
#}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Spectro Cloud credentials
2+
sc_host = "{Enter Spectro Cloud API Host}" #e.g: api.spectrocloud.com (for SaaS)
3+
sc_api_key = "{Enter Spectro Cloud API Key}"
4+
sc_project_name = "{Enter Spectro Cloud Project Name}" #e.g: Default
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
variable "sc_host" {
2+
description = "Spectro Cloud Endpoint"
3+
default = "api.spectrocloud.com"
4+
}
5+
6+
variable "sc_api_key" {
7+
description = "Spectro Cloud API key"
8+
}
9+
10+
variable "sc_project_name" {
11+
description = "Spectro Cloud Project (e.g: Default)"
12+
default = "Default"
13+
}
14+
15+
variable "ssh_key_value" {
16+
description = "ssh key value"
17+
default = "ssh-rsa ...... == [email protected]"
18+
}

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ require (
1212
github.com/robfig/cron v1.2.0
1313
github.com/spectrocloud/gomi v1.14.1-0.20240214074114-c19394812368
1414
github.com/spectrocloud/hapi v1.14.1-0.20240214071352-81f589b1d86d
15-
github.com/spectrocloud/palette-sdk-go v0.0.0-20241227233030-cd7c351b4722
15+
github.com/spectrocloud/palette-sdk-go v0.0.0-20250128161259-cb8d74607dfb
1616
github.com/stretchr/testify v1.10.0
1717
gotest.tools v2.2.0+incompatible
1818
k8s.io/api v0.23.5

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -603,6 +603,8 @@ github.com/spectrocloud/hapi v1.14.1-0.20240214071352-81f589b1d86d h1:OMRbHxMJ1a
603603
github.com/spectrocloud/hapi v1.14.1-0.20240214071352-81f589b1d86d/go.mod h1:MktpRPnSXDTHsQrFSD+daJFQ1zMLSR+1gWOL31jVvWE=
604604
github.com/spectrocloud/palette-sdk-go v0.0.0-20241227233030-cd7c351b4722 h1:Z574padnTtuCGPZfxhtbRGl3CtsAF8Zx+rc5aCo30zU=
605605
github.com/spectrocloud/palette-sdk-go v0.0.0-20241227233030-cd7c351b4722/go.mod h1:Zv1+/Imw/lIOPAa+q9TzdyKiXmIzfLSwVTj11WemIZc=
606+
github.com/spectrocloud/palette-sdk-go v0.0.0-20250128161259-cb8d74607dfb h1:SCCK69rtkmNsRFAM9EOiJMshQ9jnhoiWTJMhq9vHsz4=
607+
github.com/spectrocloud/palette-sdk-go v0.0.0-20250128161259-cb8d74607dfb/go.mod h1:Zv1+/Imw/lIOPAa+q9TzdyKiXmIzfLSwVTj11WemIZc=
606608
github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
607609
github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk=
608610
github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I=

0 commit comments

Comments
 (0)