Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add AWS AMI Resource and Data Source Support #94

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

bshutterkion
Copy link
Collaborator

Added

  • Introduced new kion_aws_ami data source to fetch AWS AMI information, including region, name, and optional regex matching filters.
  • Added kion_aws_ami resource to manage AWS AMIs within Kion, supporting fields such as account_id, aws_ami_id, name, region, and optional fields for synchronization and ownership settings.

Documentation

  • Added documentation for kion_aws_ami data source and resource, including example usage, schema details, and nested schemas for filters and lists.
  • Provided example Terraform configurations for the kion_aws_ami data source and resource.

…mission mappings

Updated the description for `user_group_ids` and `user_ids` fields across multiple resource mappings to remove the inaccurate instruction that IDs must be provided in numerical order. The affected files are:

- `resource_funding_source_permission_mapping.go`
- `resource_ou_permission_mapping.go`
- `resource_project_permission_mapping.go`
- **Docs**:
  - Created `aws_ami.md` documentation under `data-sources` and `resources` directories.
  - Added example usage for `kion_aws_ami` data source and resource.
  - Included schema details for both data source and resource.

- **Examples**:
  - Added example Terraform configurations for `kion_aws_ami` data source and resource in `examples/data-sources/kion_aws_ami` and `examples/resources/kion_aws_ami`.

- **Provider**:
  - Implemented `kion_aws_ami` data source and resource in Go.
  - Registered `kion_aws_ami` in `Provider`'s `ResourcesMap` and `DataSourcesMap`.
  - Implemented CRUD operations for `kion_aws_ami` resource.
…include additional fields for expiration and ownership details

- Added new read-only attributes to the `aws_ami` data source: `account_id`, `aws_ami_id`, `description`, `expires_at`, `name`, `owner_user_group_ids`, `owner_user_ids`, `region`, `sync_deprecation`, `sync_tags`, and `unavailable_in_aws`.
- Updated the AWS AMI resource example and schema to include new optional fields for expiration alerts and warnings (`expiration_alert_number`, `expiration_alert_unit`, `expiration_notify`, `expiration_warning_number`, `expiration_warning_unit`).
- Added new nullable handling for `expires_at` and related fields.
- Refactored code to handle and log JSON payloads for AMI creation and updates.
…omization and error handling

- Added `CustomizeDiff` function to ensure at least one of the fields `owner_user_group_ids` or `owner_user_ids` is present during the diff operation.
- Improved error handling and ID reset logic in `resourceAwsAmiDelete` function, replacing direct diagnostics appending with `hc.HandleError` and `hc.SafeSet`.
- Corrected the typo in the comment for `NullTime` struct from "JSON marshalling" to "JSON marshaling" in `helper.go`.
@bshutterkion bshutterkion marked this pull request as draft October 1, 2024 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants