Skip to content

Commit 9f28cc7

Browse files
imheresamirGitHub Enterprise
authored andcommitted
Merge pull request #23 from Conjur-Enterprise/update-readme-crud
CNJR-7915: Update readme for CRUD
2 parents 601f631 + 17fb8b2 commit 9f28cc7

File tree

2 files changed

+92
-16
lines changed

2 files changed

+92
-16
lines changed

CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
66

7-
## [0.2.3] - 2025-03-17
7+
## [0.3.0] - 2025-04-11
88

99
### Added
10+
- Added support for Import, Update, Delete (Destroy) operations for all supported resources
1011
- Removed Secretstore scan after AWS/Azure Secretstore creation to avoid conflicts
11-
- Upgraded Go to 1.23 to resolve gocovmerge dependency issues
12+
- Upgraded Go to 1.23 to resolve gocovmerge dependency issues
1213

1314
## [0.2.2] - 2024-11-22
1415

README.md

Lines changed: 89 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,95 @@ $ terraform plan
347347
348348
2. API : Use the documentation below to make an API call and retrieve the Privilege Cloud StoreID. (https://docs.cyberark.com/secrets-hub-privilege-cloud/Latest/en/Content/Developer/sh-policy-api-tutorial.htm?tocpath=Developer%7CTutorials%7C_____4).
349349
350+
## Resource Lifecycle Management
351+
352+
The CyberArk Terraform Provider supports complete lifecycle management for resources including import, update, and delete operations.
353+
354+
### Importing Existing Resources
355+
356+
You can import existing resources into your Terraform state using the `terraform import` command. This is useful when you want to start managing existing infrastructure with Terraform.
357+
358+
```sh
359+
# Import an existing AWS account
360+
terraform import cyberark_aws_account.my_account <account_id>
361+
362+
# Import an existing safe
363+
terraform import cyberark_safe.my_safe <safe_name>
364+
365+
# Import an existing sync policy
366+
terraform import cyberark_sync_policy.my_policy <policy_id>
367+
```
368+
369+
### Updating Resources
370+
371+
Resources can be updated by modifying your Terraform configuration and running `terraform apply`.
372+
373+
#### Safe Update Example
374+
```terraform
375+
resource "cyberark_safe" "my_safe" {
376+
safe_name = "example_safe"
377+
safe_desc = "Updated safe description" # Modified field
378+
member = "secretshub"
379+
member_type = "user"
380+
permission_level = "full"
381+
retention = 14 # Modified retention period
382+
purge = false
383+
}
384+
```
385+
386+
#### Account Update Example
387+
```terraform
388+
resource "cyberark_aws_account" "my_account" {
389+
name = "aws-account"
390+
username = "aws-user"
391+
platform = "AWS"
392+
safe = "aws_safe"
393+
secret = var.secret_key
394+
secret_name_in_secret_store = "updated_aws_secret_name" # Modified field
395+
sm_manage = true # Modified field
396+
sm_manage_reason = "Updated for compliance" # Modified field
397+
aws_kid = var.aws_key_id
398+
aws_account_id = var.aws_account_id
399+
aws_alias = var.aws_alias
400+
aws_account_region = var.aws_region
401+
}
402+
```
403+
404+
#### Secret Store Update Example
405+
```terraform
406+
resource "cyberark_aws_secret_store" "my_secret_store" {
407+
name = "aws-secret-store"
408+
description = "Updated AWS store description" # Modified field
409+
aws_account_id = var.aws_account_id
410+
aws_account_region = "us-east-1"
411+
aws_account_alias = "updated-aws-alias" # Modified field
412+
aws_iam_role = var.aws_iam_role
413+
}
414+
```
415+
416+
#### Sync Policy Update Example
417+
```terraform
418+
resource "cyberark_sync_policy" "my_policy" {
419+
name = "sync-policy"
420+
description = "Updated policy description" # Modified field
421+
safe_name = var.safe_name
422+
source_id = var.source_id
423+
target_id = var.target_id
424+
}
425+
```
426+
427+
### Deleting Resources
428+
429+
Resources can be deleted by removing them from your Terraform configuration and running `terraform apply`, or by using `terraform destroy` for the entire configuration.
430+
431+
```sh
432+
# Delete a specific resource
433+
terraform destroy -target=cyberark_aws_account.my_account
434+
435+
# Delete all resources in the configuration
436+
terraform destroy
437+
```
438+
350439
## Documentation
351440
352441
### Provider
@@ -370,17 +459,3 @@ $ terraform plan
370459
## Usage instructions
371460
372461
See [here](examples/) for examples.
373-
374-
## Limitations
375-
376-
The CyberArk Terraform Provider plugin does not support the following features:
377-
378-
- Update safe
379-
- Delete safe
380-
- Update account
381-
- Delete account
382-
- Update secret store
383-
- Delete secret store
384-
- Update sync policy
385-
- Delete sync policy
386-
- Rotation of auth token

0 commit comments

Comments
 (0)