Skip to content

Commit b42ff50

Browse files
ezilber-akamaizliang-akamailgarber-akamaiyec-akamaiCopilot
authored
Project: Private Image Sharing (#2170)
* Implemented Private Image Sharing features (#2129) * Added new fields to image/images datasources and resource * Project: Linode Interfaces (#1862) * Replace linodego with the feature branch version of it * Add `interfaces_for_new_linodes` attribute in account setting resource and data source (#1864) * Sync linodego feature branch * Support `config_id` in the linode interfaces in subnet resources and data sources (#1896) * Support `config_id` in the interfaces of linodes in subnet resources and data sources * Add helper func for ptr conversion * Implement firewall template and templates data sources (#1873) * sync with linodego feature branch * Linode Interfaces: Implement changes under linode_instance resource and data source (#1890) * Linode Interfaces: Add non-interface /linode/instances fields * WIP * Drop validation and add partial docs * Fix up docs * Sort imports * Update replacement * oops * remove TODO * Minor docs change * Revert replace * ADd TODO * Remove trailing space * Add interface_id in networking IP data sources (#1898) * Add interface_id in various networking IP data sources * Fix test * Update docs * Update VPC and account setting docs (#1903) * Update VPC and account setting docs * Fix descriptions in schema * sync with linodego feature branch * Implement firewall settings data source (#1905) * Implement firewall settings data source * gofumpt * Add test * Fix * Upgrade some tests to be with protocol v6 factory * Add support for interfaces in firewall resource and data source (#1899) * Add support for interfaces in firewall resource and data source * Add unit test * Add TODO for acceptance tests * Update docs * Add interfaces support in firewalls data source (#1902) * Add interfaces support in firewalls data source * Update and migrate tests * Update doc * Migrate to firewall settings data source to be with nested object (#1947) * golangci-lint run --fix && golangci-lint fmt * Sync linodego version * Set config_id to null attribute when it's Go zero value (#1953) Co-authored-by: Ye Chen <127243817+yec-akamai@users.noreply.github.com> * Implement firewall settings resource (#1963) * Implementation and tests for linode_firewall_settings resource * Add doc * Remove ID referencing * Fix doc * Add tag for integration test * Fix * golangci-lint fmt * Cleanup * Fix nil pointer panic * Sync linodego * Sync linodego feature branch * go mod tidy * golangci-lint fmt * Repin linodego to released version * Fix * Add nested object update helper (#2002) * Implement nested object update helper * Add isNull return (pass by ptr) * FIx * Minor change * Implement linode interface resource (#2087) * Implement linode interface resource * Cleanup boolTrue and boolFalse * Cleanup debugging stuff * cleanup * golangci-lint fmt * Adjust importing IDs order * Remove redundant * Improved doc * improved test * Fix lint * Copilot fixed doc * Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update linode/firewall/framework_models.go Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Fix * Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update linode/firewalltemplates/tmpl/data_filter.gotf Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update docs/data-sources/vpc_subnets.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update docs/data-sources/vpc_subnet.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update linode/firewallsettings/framework_resource.go Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Lena Garber <114949949+lgarber-akamai@users.noreply.github.com> Co-authored-by: Ye Chen <127243817+yec-akamai@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Added datasource/resource for Image Share Group * Normalize null value for Images to [] for consistent behavior * Add logging for Linode interface resource (#2132) * Add 30s waiting period for OBJ temp key for E2/3 endpoints; update docs (#2133) * Added Image Share Groups datasource and Image Share Group Member resource * Added datasource for Image Shares * VPC Dual Stack: Add support for IPv6 VPC in linode_interface resource (#2096) * VPC Dual Stack: Add support for IPv6 VPC in linode_interface resource * fix ordering * Update docs/data-sources/vpc_subnets.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update docs/data-sources/vpc_subnet.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Add validation to VPC and Subnet creation to prevent unexpected errors without VPC IPv6 enrollment * minor rework * oops --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Remove unnecessary sweep function (#2135) * Add ID for firewall setting resource and data source (#2136) * Add ID for firewall setting resource and data source * go mod tidy * Added Image Share Group Token resource * Add Linode interface related packages to the integration test CI (#2138) * Added docs and integration tests for ImageShareGroupToken and ImageShareGroupMember resources * Added Image Share Group Member datasource * Added ImageShareGroupMembers datasource * Added ImageShareGroupToken datasource * Added ImageShareGroupTokens datasource * Added datasource for Consumer Image Share Group * Added ConsumerImageShareGroupImageShares datasource * Point to more recent linodego commit * Fixes * Added LA notices to docs * Added documentation links * Point at latest linodego release * Added new tokens to integration_tests.yml * Added new tokens to integration_tests_pr.yml * Fix test * Addressed PR comments --------- Co-authored-by: Zhiwei Liang <121905282+zliang-akamai@users.noreply.github.com> Co-authored-by: Lena Garber <114949949+lgarber-akamai@users.noreply.github.com> Co-authored-by: Ye Chen <127243817+yec-akamai@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Ran go mod tidy * Fixed filtering for image share group members --------- Co-authored-by: Zhiwei Liang <121905282+zliang-akamai@users.noreply.github.com> Co-authored-by: Lena Garber <114949949+lgarber-akamai@users.noreply.github.com> Co-authored-by: Ye Chen <127243817+yec-akamai@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 9a681aa commit b42ff50

File tree

99 files changed

+6022
-46
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+6022
-46
lines changed

.github/workflows/integration_tests.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,10 @@ jobs:
5555
run: |
5656
case "${{ matrix.user }}" in
5757
"USER_1")
58-
echo "TEST_SUITE=acceptance,backup,domain,domainrecord,domains,domainzonefile,helper,instance,provider" >> $GITHUB_ENV
58+
echo "TEST_SUITE=acceptance,backup,consumerimagesharegroup,consumerimagesharegroupimageshares,consumerimagesharegrouptoken,consumerimagesharegrouptokens,producerimagesharegroup,producerimagesharegroupimageshares,producerimagesharegroupmember,producerimagesharegroupmembers,producerimagesharegroups,domain,domainrecord,domains,domainzonefile,helper,instance,provider" >> $GITHUB_ENV
5959
echo "LINODE_TOKEN=${{ secrets.LINODE_TOKEN_USER_1 }}" >> $GITHUB_ENV
60+
echo "LINODE_PRODUCER_TOKEN=${{ secrets.LINODE_TOKEN_USER_1 }}" >> $GITHUB_ENV
61+
echo "LINODE_CONSUMER_TOKEN=${{ secrets.LINODE_TOKEN_USER_2 }}" >> $GITHUB_ENV
6062
;;
6163
"USER_2")
6264
echo "TEST_SUITE=databasemysqlv2,firewall,firewallsettings,firewalltemplate,firewalltemplates,firewalldevice,firewalls,image,images,instancenetworking,instancesharedips,instancetype,instancetypes,ipv6range,ipv6ranges,kernel,kernels,nb,nbconfig,nbconfigs,nbnode,nbs,nbvpc,nbvpcs,sshkey,sshkeys,vlan,volume,volumes,vpc,vpcs,vpcsubnets,vpcips" >> $GITHUB_ENV
@@ -80,6 +82,8 @@ jobs:
8082
make TEST_SUITE="${{ env.TEST_SUITE }}" PARALLEL="${{ github.event.inputs.parallel_value || '5' }}" test-int | go-junit-report -set-exit-code -iocopy -out $REPORT_FILENAME
8183
env:
8284
LINODE_TOKEN: ${{ env.LINODE_TOKEN }}
85+
LINODE_PRODUCER_TOKEN: ${{ env.LINODE_PRODUCER_TOKEN }}
86+
LINODE_CONSUMER_TOKEN: ${{ env.LINODE_CONSUMER_TOKEN }}
8387

8488
- name: Upload Test Report as Artifact
8589
if: always()

.github/workflows/integration_tests_pr.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,10 @@ jobs:
6363
if: ${{ steps.disallowed-character-check.outputs.result == 'pass' }}
6464
env:
6565
LINODE_TOKEN: ${{ secrets.DX_LINODE_TOKEN }}
66+
LINODE_PRODUCER_TOKEN: ${{ secrets.DX_LINODE_TOKEN }}
67+
LINODE_CONSUMER_TOKEN: ${{ secrets.LINODE_TOKEN_USER_2 }}
6668
RUN_LONG_TESTS: ${{ inputs.run_long_tests }}
67-
69+
6870
- name: Get the hash value of the latest commit from the PR branch
6971
uses: octokit/graphql-action@v2.x
7072
id: commit-hash
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
page_title: "Linode: linode_consumer_image_share_group"
3+
description: |-
4+
Provides details about an Image Share Group a consumer's token has been accepted into.
5+
---
6+
7+
# Data Source: linode\_consumer\_image\_share\_group
8+
9+
`linode_consumer_image_share_group` provides details about an Image Share Group that the user's token has been accepted into.
10+
For more information, see the [Linode APIv4 docs](https://techdocs.akamai.com/linode-api/reference/get-sharegroup-by-token). May not be currently available to all users even under v4beta.
11+
12+
## Example Usage
13+
14+
The following example shows how the datasource might be used to obtain additional information about an Image Share Group.
15+
16+
```hcl
17+
data "linode_consumer_image_share_group" "sg" {
18+
token_uuid = "7548d17e-8db4-4a91-b47c-a8e1203063d9"
19+
}
20+
```
21+
22+
## Argument Reference
23+
24+
* `token_uuid` - (Required) The UUID of the token that has been accepted into the Image Share Group.
25+
26+
## Attributes Reference
27+
28+
In addition to all arguments above, the following attributes are exported:
29+
30+
* `id` - The ID of the Image Share Group.
31+
32+
* `uuid` - The UUID of the Image Share Group.
33+
34+
* `label` - The label of the Image Share Group.
35+
36+
* `description` - The description of the Image Share Group.
37+
38+
* `is_suspended` - Whether the Image Share Group is suspended.
39+
40+
* `created` - The date and time the Image Share Group was created.
41+
42+
* `updated` - The date and time the Image Share Group was last updated.
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
---
2+
page_title: "Linode: linode_consumer_image_share_group_image_shares"
3+
description: |-
4+
Lists Images shared in the Image Share Group the provided Token has been accepted into.
5+
---
6+
7+
# Data Source: linode\_consumer\_image\_share\_group\_image\_shares
8+
9+
Provides information about a list of Images that match a set of filters that have been
10+
shared in the Image Share Group that the provided Token has been accepted into.
11+
For more information, see the [Linode APIv4 docs](https://techdocs.akamai.com/linode-api/reference/get-sharegroup-images-by-token). May not be currently available to all users even under v4beta.
12+
13+
## Example Usage
14+
15+
The following example shows how one might use this data source to list Images shared in an Image Share Group.
16+
17+
```hcl
18+
data "linode_consumer_image_share_group_image_shares" "all" {}
19+
20+
data "linode_consumer_image_share_group_image_shares" "filtered" {
21+
token_uuid = "54e1adf3-e499-4685-82be-10d29d4e8fae"
22+
filter {
23+
name = "label"
24+
values = ["my-label"]
25+
}
26+
}
27+
28+
output "all-shared-images" {
29+
value = data.linode_consumer_image_share_group_image_shares.all.image_shares
30+
}
31+
32+
output "filtered-shared-images" {
33+
value = data.linode_consumer_image_share_group_image_shares.filtered.image_shares
34+
}
35+
```
36+
37+
## Argument Reference
38+
39+
The following arguments are supported:
40+
41+
* `token_uuid` - (Required) The UUID of the Token that has been accepted into the Image Share Group to list shared Images from.
42+
43+
* [`filter`](#filter) - (Optional) A set of filters used to select Image Share Groups that meet certain requirements.
44+
45+
### Filter
46+
47+
* `name` - (Required) The name of the field to filter by. See the [Filterable Fields section](#filterable-fields) for a complete list of filterable fields.
48+
49+
* `values` - (Required) A list of values for the filter to allow. These values should all be in string form.
50+
51+
* `match_by` - (Optional) The method to match the field by. (`exact`, `regex`, `substring`; default `exact`)
52+
53+
## Attributes Reference
54+
55+
Each Image Share will be stored in the `images_shares` attribute and will export the following attributes:
56+
57+
* `id` - The unique ID assigned to this Image Share.
58+
59+
* `label` - The label of the Image Share.
60+
61+
* `capabilities` - The capabilities of the Image represented by the Image Share.
62+
63+
* `created` - When this Image Share was created.
64+
65+
* `deprecated` - Whether this Image is deprecated.
66+
67+
* `description` - A description of the Image Share.
68+
69+
* `is_public` - True if the Image is public.
70+
71+
* `image_sharing` - Details about image sharing, including who the image is shared with and by.
72+
* `shared_with` - Details about who the image is shared with.
73+
* `sharegroup_count` - The number of sharegroups the private image is present in.
74+
* `sharegroup_list_url` - The GET api url to view the sharegroups in which the image is shared.
75+
* `shared_by` - Details about who the image is shared by.
76+
* `sharegroup_id` - The sharegroup_id from the im_ImageShare row.
77+
* `sharegroup_uuid` - The sharegroup_uuid from the im_ImageShare row.
78+
* `sharegroup_label` - The label from the associated im_ImageShareGroup row.
79+
* `source_image_id` - The image id of the base image (will only be shown to producers, will be null for consumers).
80+
81+
* `size` - The minimum size this Image needs to deploy. Size is in MB. example: 2500
82+
83+
* `status` - The current status of this image. (`creating`, `pending_upload`, `available`)
84+
85+
* `type` - How the Image was created. Manual Images can be created at any time. "Automatic" Images are created automatically from a deleted Linode. (`manual`, `automatic`)
86+
87+
* `tags` - A list of customized tags.
88+
89+
* `total_size` - The total size of the image in all available regions.
90+
91+
## Filterable Fields
92+
93+
* `id`
94+
95+
* `label`
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
page_title: "Linode: linode_consumer_image_share_group_token"
3+
description: |-
4+
Provides details about a Token for an Image Share Group.
5+
---
6+
7+
# Data Source: linode\_consumer\_image\_share\_group\_token
8+
9+
`linode_consumer_image_share_group_token` provides details about a Token for an Image Share Group.
10+
For more information, see the [Linode APIv4 docs](https://techdocs.akamai.com/linode-api/reference/get-sharegroup-token). May not be currently available to all users even under v4beta.
11+
12+
## Example Usage
13+
14+
The following example shows how the datasource might be used to obtain additional information about a Token for an Image Share Group.
15+
16+
```hcl
17+
data "linode_consumer_image_share_group_token" "token" {
18+
token_uuid = "db58ab2e-3021-4b08-9426-8e456f6dd268"
19+
}
20+
```
21+
22+
## Argument Reference
23+
24+
The following arguments are supported:
25+
26+
* `token_uuid` - (Required) The UUID of the token.
27+
28+
## Attributes Reference
29+
30+
In addition to all the arguments above, the following attributes are exported.
31+
32+
* `label` - A label for the token.
33+
34+
* `status` - The status of the token.
35+
36+
* `created` - When the token was created.
37+
38+
* `updated` - When the token was last updated.
39+
40+
* `expiry` - When the token will expire.
41+
42+
* `valid_for_sharegroup_uuid` - The UUID of the Image Share Group for which to create a token.
43+
44+
* `sharegroup_uuid` - The UUID of the Image Share Group that the token is for.
45+
46+
* `sharegroup_label` - The label of the Image Share Group that the token is for.
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
---
2+
page_title: "Linode: linode_consumer_image_share_group_tokens"
3+
description: |-
4+
Lists Image Share Group Tokens on your account.
5+
---
6+
7+
# Data Source: linode\_consumer\_image\_share\_group\_tokens
8+
9+
Provides information about a list of Image Share Group Tokens that match a set of filters.
10+
For more information, see the [Linode APIv4 docs](https://techdocs.akamai.com/linode-api/reference/get-user-tokens). May not be currently available to all users even under v4beta.
11+
12+
## Example Usage
13+
14+
The following example shows how one might use this data source to list Image Share Groups.
15+
16+
```hcl
17+
data "linode_consumer_image_share_group_tokens" "all" {}
18+
19+
data "linode_consumer_image_share_group_tokens" "filtered" {
20+
filter {
21+
name = "label"
22+
values = ["my-label"]
23+
}
24+
}
25+
26+
output "all-share-group-tokens" {
27+
value = data.linode_consumer_image_share_group_tokens.all.tokens
28+
}
29+
30+
output "filtered-share-group-tokens" {
31+
value = data.linode_consumer_image_share_group_tokens.filtered.tokens
32+
}
33+
```
34+
35+
## Argument Reference
36+
37+
The following arguments are supported:
38+
39+
* [`filter`](#filter) - (Optional) A set of filters used to select Image Share Groups that meet certain requirements.
40+
41+
### Filter
42+
43+
* `name` - (Required) The name of the field to filter by. See the [Filterable Fields section](#filterable-fields) for a complete list of filterable fields.
44+
45+
* `values` - (Required) A list of values for the filter to allow. These values should all be in string form.
46+
47+
* `match_by` - (Optional) The method to match the field by. (`exact`, `regex`, `substring`; default `exact`)
48+
49+
## Attributes Reference
50+
51+
In addition to all arguments above, the following attributes are exported:
52+
53+
* `token_uuid` - The UUID of the token.
54+
55+
* `label` - A label for the token.
56+
57+
* `status` - The status of the token.
58+
59+
* `created` - When the token was created.
60+
61+
* `updated` - When the token was last updated.
62+
63+
* `expiry` - When the token will expire.
64+
65+
* `valid_for_sharegroup_uuid` - The UUID of the Image Share Group for which to create a token.
66+
67+
* `sharegroup_uuid` - The UUID of the Image Share Group that the token is for.
68+
69+
* `sharegroup_label` - The label of the Image Share Group that the token is for.
70+
71+
## Filterable Fields
72+
73+
* `token_uuid`
74+
75+
* `label`
76+
77+
* `status`
78+
79+
* `valid_for_sharegroup_uuid`
80+
81+
* `sharegroup_uuid`
82+
83+
* `sharegroup_label`

docs/data-sources/image.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,18 @@ The Linode Image resource exports the following attributes:
4141

4242
* `is_public` - True if the Image is public.
4343

44+
* `is_shared` - True if the Image is shared. (**Note: v4beta only and may not currently be available to all users.**)
45+
46+
* `image_sharing` - Details about image sharing, including who the image is shared with and by. (**Note: v4beta only and may not currently be available to all users.**)
47+
* `shared_with` - Details about who the image is shared with.
48+
* `sharegroup_count` - The number of sharegroups the private image is present in.
49+
* `sharegroup_list_url` - The GET api url to view the sharegroups in which the image is shared.
50+
* `shared_by` - Details about who the image is shared by.
51+
* `sharegroup_id` - The sharegroup_id from the im_ImageShare row.
52+
* `sharegroup_uuid` - The sharegroup_uuid from the im_ImageShare row.
53+
* `sharegroup_label` - The label from the associated im_ImageShareGroup row.
54+
* `source_image_id` - The image id of the base image (will only be shown to producers, will be null for consumers).
55+
4456
* `size` - The minimum size this Image needs to deploy. Size is in MB. example: 2500
4557

4658
* `status` - The current status of this image. (`creating`, `pending_upload`, `available`)

docs/data-sources/images.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,18 @@ Each Linode image will be stored in the `images` attribute and will export the f
7979

8080
* `is_public` - True if the Image is public.
8181

82+
* `is_shared` - True if the Image is shared. (**Note: v4beta only and may not currently be available to all users.**)
83+
84+
* `image_sharing` - Details about image sharing, including who the image is shared with and by. (**Note: v4beta only and may not currently be available to all users.**)
85+
* `shared_with` - Details about who the image is shared with.
86+
* `sharegroup_count` - The number of sharegroups the private image is present in.
87+
* `sharegroup_list_url` - The GET api url to view the sharegroups in which the image is shared.
88+
* `shared_by` - Details about who the image is shared by.
89+
* `sharegroup_id` - The sharegroup_id from the im_ImageShare row.
90+
* `sharegroup_uuid` - The sharegroup_uuid from the im_ImageShare row.
91+
* `sharegroup_label` - The label from the associated im_ImageShareGroup row.
92+
* `source_image_id` - The image id of the base image (will only be shown to producers, will be null for consumers).
93+
8294
* `size` - The minimum size this Image needs to deploy. Size is in MB. example: 2500
8395

8496
* `status` - The current status of this image. (`creating`, `pending_upload`, `available`)
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
page_title: "Linode: linode_producer_image_share_group"
3+
description: |-
4+
Provides details about an Image Share Group created by a producer.
5+
---
6+
7+
# Data Source: linode\_producer\_image\_share\_group
8+
9+
`linode_producer_image_share_group` provides details about an Image Share Group.
10+
For more information, see the [Linode APIv4 docs](https://techdocs.akamai.com/linode-api/reference/get-sharegroup). May not be currently available to all users even under v4beta.
11+
12+
## Example Usage
13+
14+
The following example shows how the datasource might be used to obtain additional information about an Image Share Group.
15+
16+
```hcl
17+
data "linode_producer_image_share_group" "sg" {
18+
id = 12345
19+
}
20+
```
21+
22+
## Argument Reference
23+
24+
* `id` - (Required) The ID of the Image Share Group.
25+
26+
## Attributes Reference
27+
28+
In addition to all arguments above, the following attributes are exported:
29+
30+
* `uuid` - The UUID of the Image Share Group.
31+
32+
* `label` - The label of the Image Share Group.
33+
34+
* `description` - The description of the Image Share Group.
35+
36+
* `is_suspended` - Whether the Image Share Group is suspended.
37+
38+
* `images_count` - The number of images in the Image Share Group.
39+
40+
* `members_count` - The number of members in the Image Share Group.
41+
42+
* `created` - The date and time the Image Share Group was created.
43+
44+
* `updated` - The date and time the Image Share Group was last updated.
45+
46+
* `expiry` - The date and time the Image Share Group will expire.

0 commit comments

Comments
 (0)