terraform: support AWS marketplace images (#2888)

* terraform: support AWS marketplace images

* terraform-provider: support AWS marketplace images

* docs: add instructions on AWS marketplace images

* ci: adapt marketplace image test for AWS

* Update internal/config/config.go

Co-authored-by: Moritz Eckert <m1gh7ym0@gmail.com>

* docs: update config

* Update docs/docs/getting-started/marketplaces.md

Co-authored-by: Thomas Tendyck <51411342+thomasten@users.noreply.github.com>

* docs: update license information

* docs: use CSP tabs for marketplace overview

* Update docs/docs/getting-started/marketplaces.md

Co-authored-by: Thomas Tendyck <51411342+thomasten@users.noreply.github.com>

* Update docs/docs/getting-started/marketplaces.md

Co-authored-by: Thomas Tendyck <51411342+thomasten@users.noreply.github.com>

* Update docs/docs/getting-started/marketplaces.md

Co-authored-by: Thomas Tendyck <51411342+thomasten@users.noreply.github.com>

---------

Co-authored-by: Moritz Eckert <m1gh7ym0@gmail.com>
Co-authored-by: Thomas Tendyck <51411342+thomasten@users.noreply.github.com>
This commit is contained in:
Moritz Sanft 2024-02-06 12:13:59 +01:00 committed by GitHub
parent 64c32c2236
commit dde3430da8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 84 additions and 29 deletions

View file

@ -87,8 +87,8 @@ func (d *ImageDataSource) Schema(_ context.Context, _ datasource.SchemaRequest,
},
"csp": newCSPAttributeSchema(),
"marketplace_image": schema.BoolAttribute{
Description: "Whether a marketplace image should be used. Currently only supported for Azure and GCP.",
MarkdownDescription: "Whether a marketplace image should be used. Currently only supported for Azure and GCP.",
Description: "Whether a marketplace image should be used.",
MarkdownDescription: "Whether a marketplace image should be used.",
Optional: true,
},
"region": schema.StringAttribute{
@ -128,14 +128,6 @@ func (d *ImageDataSource) ValidateConfig(ctx context.Context, req datasource.Val
)
}
// Marketplace image is only supported for Azure and GCP
if data.CSP.Equal(types.StringValue("aws")) && !data.MarketplaceImage.IsNull() {
resp.Diagnostics.AddAttributeError(
path.Root("marketplace_image"),
"Marketplace images are currently only supported on Azure and GCP", "When another CSP than Azure or GCP is used, marketplace images are unavailable.",
)
}
// Version should be a valid semver or short path, if set
if !data.Version.IsNull() {
_, semverErr := semver.New(data.Version.ValueString())