diff --git a/docs/index.md b/docs/index.md index 88a3d9d..a929542 100644 --- a/docs/index.md +++ b/docs/index.md @@ -13,7 +13,10 @@ description: |- ## Example Usage ```terraform -provider "ksoc" {} +provider "ksoc" { + access_key_id = "ksoc_access_key" + secret_key = "ksoc_secret_key" +} ``` @@ -24,6 +27,6 @@ provider "ksoc" {} - `access_key_id` (String, Sensitive) Ksoc Customer Access ID - `secret_key` (String, Sensitive) Ksoc Customer Secret Key -### Read-Only +### Optional - `ksoc_api_url` (String) Ksoc API to target. Defaults to https://api.ksoc.com diff --git a/examples/provider/provider.tf b/examples/provider/provider.tf index e31c54f..ce38432 100644 --- a/examples/provider/provider.tf +++ b/examples/provider/provider.tf @@ -1 +1,4 @@ -provider "ksoc" {} +provider "ksoc" { + access_key_id = "ksoc_access_key" + secret_key = "ksoc_secret_key" +} diff --git a/examples/resources/aws_register/main.tf b/examples/resources/aws_register/main.tf index 3fdd8ec..d18b4e4 100644 --- a/examples/resources/aws_register/main.tf +++ b/examples/resources/aws_register/main.tf @@ -1,7 +1,4 @@ resource "ksoc_aws_register" "this" { - ksoc_api_url = "" ksoc_assumed_role_arn = "arn:aws:iam:::role/ksoc-connector" - access_key_id = "ksoc_access_key" - secret_key = "ksoc_secret_key" aws_account_id = "aws_account_id" } diff --git a/internal/ksoc/provider.go b/internal/ksoc/provider.go index a60e78d..ef21c8a 100644 --- a/internal/ksoc/provider.go +++ b/internal/ksoc/provider.go @@ -18,8 +18,8 @@ func New(version string) func() *schema.Provider { "ksoc_api_url": { Type: schema.TypeString, Description: "Ksoc API to target. Defaults to https://api.ksoc.com", - Computed: true, - Required: false, + Default: "https://api.ksoc.com", + Optional: true, }, "access_key_id": { Type: schema.TypeString, @@ -53,13 +53,8 @@ type Config struct { } func configureProvider(ctx context.Context, d *schema.ResourceData) (interface{}, diag.Diagnostics) { - ksocApiUrl := d.Get("ksoc_api_url").(string) - if ksocApiUrl == "" { - ksocApiUrl = "https://api.ksoc.com" - } - config := Config{ - KsocApiUrl: ksocApiUrl, + KsocApiUrl: d.Get("ksoc_api_url").(string), AccessKeyId: d.Get("access_key_id").(string), SecretKey: d.Get("secret_key").(string), }