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

Feature(Reservations): UI-31879: Reservations #293

Closed
wants to merge 21 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
092828d
Feature(Reservations): UI-31879: Reservations
sreekarbvibm Sep 28, 2023
a9e2c5f
fix docs
sreekarbvibm Sep 28, 2023
3fe0476
Fix terraform formatting
sreekarbvibm Oct 4, 2023
2fc4f47
instance reservation
sreekarbvibm Nov 20, 2023
4cac815
Merge remote-tracking branch 'origin/master' into reservations
sreekarbvibm Nov 20, 2023
8aa695b
remove changes came as part of merge
sreekarbvibm Nov 20, 2023
af58f1a
remove changes came as part of merge
sreekarbvibm Nov 20, 2023
c7b69cd
remove changes came as part of merge
sreekarbvibm Nov 20, 2023
be8cd23
add development maturity to sdk, minor fixes while testing
sreekarbvibm Nov 20, 2023
2e2223e
acceptance test
sreekarbvibm Nov 20, 2023
e58508a
doc update, instance profile changes
sreekarbvibm Nov 20, 2023
81772d8
Merge remote-tracking branch 'origin/master' into reservations
sreekarbvibm Nov 20, 2023
6938129
address review comments
sreekarbvibm Nov 21, 2023
bf21286
add additional data source test case
sreekarbvibm Nov 21, 2023
f5abe85
address review comments, add mvp example for instance with reservation
sreekarbvibm Nov 28, 2023
8092e9f
update sdk maturity to beta, update docs with links
sreekarbvibm Dec 5, 2023
0916b06
Merge branch 'master' into reservations
sreekarbvibm Dec 6, 2023
0849156
Merge branch 'master' into reservations
sreekarbvibm Jan 23, 2024
0afe0d2
fix compile issues
sreekarbvibm Jan 23, 2024
98450ad
feature(reservations): support for instance reservations
sreekarbvibm Jan 31, 2024
93f8a03
fix(reservations): UI-34823: read resource group attribute during res…
sreekarbvibm Feb 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add additional data source test case
sreekarbvibm committed Nov 21, 2023
commit bf212860e737712aa5010cd841ef3759cb60e68f
40 changes: 38 additions & 2 deletions ibm/service/vpc/data_source_ibm_is_reservation_test.go
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@ func TestAccIBMISReservationDatasource_basic(t *testing.T) {
Providers: acc.TestAccProviders,
Steps: []resource.TestStep{
{
Config: testDSCheckIBMISReservationConfig(),
Config: testDSCheckIBMISReservationConfigById(),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttrSet("data.ibm_is_reservation.ds_res", "id"),
resource.TestCheckResourceAttrSet("data.ibm_is_reservation.ds_res", "created_at"),
@@ -32,11 +32,26 @@ func TestAccIBMISReservationDatasource_basic(t *testing.T) {
resource.TestCheckResourceAttrSet("data.ibm_is_reservation.ds_res", "zone"),
),
sreekarbvibm marked this conversation as resolved.
Show resolved Hide resolved
},
{
Config: testDSCheckIBMISReservationConfigByName(),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttrSet("data.ibm_is_reservation.ds_res", "name"),
resource.TestCheckResourceAttrSet("data.ibm_is_reservation.ds_res", "created_at"),
resource.TestCheckResourceAttrSet("data.ibm_is_reservation.ds_res", "crn"),
resource.TestCheckResourceAttrSet("data.ibm_is_reservation.ds_res", "href"),
resource.TestCheckResourceAttrSet("data.ibm_is_reservation.ds_res", "lifecycle_state"),
resource.TestCheckResourceAttrSet("data.ibm_is_reservation.ds_res", "name"),
resource.TestCheckResourceAttrSet("data.ibm_is_reservation.ds_res", "profile.#"),
resource.TestCheckResourceAttrSet("data.ibm_is_reservation.ds_res", "resource_group.#"),
resource.TestCheckResourceAttrSet("data.ibm_is_reservation.ds_res", "resource_type"),
resource.TestCheckResourceAttrSet("data.ibm_is_reservation.ds_res", "zone"),
),
},
},
})
}

func testDSCheckIBMISReservationConfig() string {
func testDSCheckIBMISReservationConfigById() string {
return fmt.Sprintf(`
resource "ibm_is_reservation" "res" {
capacity {
@@ -56,3 +71,24 @@ func testDSCheckIBMISReservationConfig() string {
identifier = ibm_is_reservation.res.id
}`)
}

func testDSCheckIBMISReservationConfigByName() string {
return fmt.Sprintf(`
resource "ibm_is_reservation" "res" {
capacity {
total = 5
}
committed_use {
term = "one_year"
}
profile {
name = "cx2-2x4"
resource_type = "instance_profile"
}
zone = "us-south-1"
name = "reservation-name"
}
data "ibm_is_reservation" "ds_res" {
name = ibm_is_reservation.res.name
}`)
}