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

feat(share-snapshot): Support for File share snapshot #389

Open
wants to merge 21 commits into
base: master
Choose a base branch
from

Conversation

deepaksibm
Copy link
Collaborator

No description provided.

@deepaksibm
Copy link
Collaborator Author

resource "ibm_is_share" "test_share" {
  name    = "tfp-tmp-test"
  size    = 100
  profile = "dp2"
  zone    = "us-south-2"
}
resource "ibm_is_share_snapshot" "is_share_snapshot_instance" {
    share = ibm_is_share.test_share.id
    name = "tfp-share-snap"
    user_tags = ["tf-share-snap-tag-1"]
}
resource "ibm_is_share" "test_share_from_snapshot" {
  name    = "tfp-tmp-test-snap-share"
  size    = 100
  profile = "dp2"
  source_snapshot {
    id = ibm_is_share_snapshot.is_share_snapshot_instance.share_snapshot
  }
}
# ibm_is_share.test_share:
resource "ibm_is_share" "test_share" {
    access_control_mode              = "security_group"
    access_tags                      = []
    accessor_binding_role            = "none"
    accessor_bindings                = []
    allowed_transit_encryption_modes = [
        "user_managed",
        "none",
    ]
    created_at                       = "2024-12-03T04:22:40.000Z"
    crn                              = "crn:v1:staging:public:is:us-south-2:a/2d1bace7b46e4815a81e52c6ffeba5cf::share:r134-6dd7cb56-a711-40c9-947b-4ee5856e04df"
    encryption                       = "provider_managed"
    href                             = "https://us-south-stage01.iaasdev.cloud.ibm.com/v1/shares/r134-6dd7cb56-a711-40c9-947b-4ee5856e04df"
    id                               = "r134-6dd7cb56-a711-40c9-947b-4ee5856e04df"
    iops                             = 100
    latest_job                       = []
    latest_sync                      = []
    lifecycle_reasons                = []
    lifecycle_state                  = "stable"
    name                             = "tfp-tmp-test"
    profile                          = "dp2"
    replication_role                 = "none"
    replication_status               = "none"
    replication_status_reasons       = []
    resource_group                   = "cdc21b72d4e647b195de988b175e3d82"
    resource_type                    = "share"
    size                             = 100
    snapshot_count                   = 1
    snapshot_directory_visible       = true
    snapshot_size                    = 1
    tags                             = []
    zone                             = "us-south-2"
}

# ibm_is_share.test_share_from_snapshot:
resource "ibm_is_share" "test_share_from_snapshot" {
    access_control_mode              = "security_group"
    access_tags                      = []
    accessor_binding_role            = "none"
    accessor_bindings                = []
    allowed_transit_encryption_modes = [
        "user_managed",
        "none",
    ]
    created_at                       = "2024-12-04T04:16:07.000Z"
    crn                              = "crn:v1:staging:public:is:us-south-2:a/2d1bace7b46e4815a81e52c6ffeba5cf::share:r134-7382e87d-76c6-4933-ad4b-94a3ba57d378"
    encryption                       = "provider_managed"
    href                             = "https://us-south-stage01.iaasdev.cloud.ibm.com/v1/shares/r134-7382e87d-76c6-4933-ad4b-94a3ba57d378"
    id                               = "r134-7382e87d-76c6-4933-ad4b-94a3ba57d378"
    iops                             = 100
    latest_job                       = []
    latest_sync                      = []
    lifecycle_reasons                = []
    lifecycle_state                  = "stable"
    name                             = "tfp-tmp-test-snap-share"
    profile                          = "dp2"
    replication_role                 = "none"
    replication_status               = "none"
    replication_status_reasons       = []
    resource_group                   = "cdc21b72d4e647b195de988b175e3d82"
    resource_type                    = "share"
    size                             = 100
    snapshot_count                   = 0
    snapshot_directory_visible       = true
    snapshot_size                    = 0
    tags                             = []
    zone                             = "us-south-2"

    source_snapshot {
        crn           = "crn:v1:staging:public:is:us-south-2:a/2d1bace7b46e4815a81e52c6ffeba5cf::share-snapshot:r134-6dd7cb56-a711-40c9-947b-4ee5856e04df/r134-c39e8012-24b7-40ed-8ac2-41e6440b472e"
        deleted       = []
        href          = "https://us-south-stage01.iaasdev.cloud.ibm.com/v1/shares/r134-6dd7cb56-a711-40c9-947b-4ee5856e04df/snapshots/r134-c39e8012-24b7-40ed-8ac2-41e6440b472e"
        id            = "r134-c39e8012-24b7-40ed-8ac2-41e6440b472e"
        name          = "tfp-share-snap"
        resource_type = "share_snapshot"
    }
}

# ibm_is_share_snapshot.is_share_snapshot_instance:
resource "ibm_is_share_snapshot" "is_share_snapshot_instance" {
    backup_policy_plan = [
        {},
    ]
    captured_at        = "2024-12-03T04:22:55.000Z"
    created_at         = "2024-12-03T04:22:55.000Z"
    crn                = "crn:v1:staging:public:is:us-south-2:a/2d1bace7b46e4815a81e52c6ffeba5cf::share-snapshot:r134-6dd7cb56-a711-40c9-947b-4ee5856e04df/r134-c39e8012-24b7-40ed-8ac2-41e6440b472e"
    fingerprint        = "2ebc91be-da2a-4989-b750-06272de19e46"
    href               = "https://us-south-stage01.iaasdev.cloud.ibm.com/v1/shares/r134-6dd7cb56-a711-40c9-947b-4ee5856e04df/snapshots/r134-c39e8012-24b7-40ed-8ac2-41e6440b472e"
    id                 = "r134-6dd7cb56-a711-40c9-947b-4ee5856e04df/r134-c39e8012-24b7-40ed-8ac2-41e6440b472e"
    lifecycle_state    = "stable"
    minimum_size       = 100
    name               = "tfp-share-snap"
    resource_group     = [
        {
            href = "https://resource-controller.test.cloud.ibm.com/v2/resource_groups/cdc21b72d4e647b195de988b175e3d82"
            id   = "cdc21b72d4e647b195de988b175e3d82"
            name = "Default"
        },
    ]
    resource_type      = "share_snapshot"
    share              = "r134-6dd7cb56-a711-40c9-947b-4ee5856e04df"
    share_snapshot     = "r134-c39e8012-24b7-40ed-8ac2-41e6440b472e"
    status             = "available"
    status_reasons     = []
    user_tags          = [
        "tf-share-snap-tag-1",
    ]
    zone               = [
        {
            href = "https://us-south-stage01.iaasdev.cloud.ibm.com/v1/regions/us-south/zones/us-south-2"
            name = "us-south-2"
        },
    ]
}

@deepaksibm
Copy link
Collaborator Author

data "ibm_is_share" "share_snap" {
  name = ibm_is_share.test_share_from_snapshot.name
}
data "ibm_is_shares" "shares" {
}
data "ibm_is_share_snapshots" "example1" {
}
data "ibm_is_share_snapshots" "example2" {
    share = ibm_is_share_snapshot.is_share_snapshot_instance.share
}
data "ibm_is_share_snapshot" "example1" {
    share = ibm_is_share_snapshot.is_share_snapshot_instance.share
    share_snapshot = ibm_is_share_snapshot.is_share_snapshot_instance.share_snapshot
}

@deepaksibm deepaksibm marked this pull request as ready for review December 4, 2024 14:53
Copy link
Collaborator

@ujjwal-ibm ujjwal-ibm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

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