diff --git a/datasource/omi/data.go b/datasource/omi/data.go index 49418a99..454940a5 100644 --- a/datasource/omi/data.go +++ b/datasource/omi/data.go @@ -55,17 +55,17 @@ func (d *Datasource) Configure(raws ...interface{}) error { } type DatasourceOutput struct { - // The ID of the AMI. + // The ID of the OMI. ID string `mapstructure:"id"` - // The name of the AMI. + // The name of the OMI. Name string `mapstructure:"name"` - // The date of creation of the AMI. + // The date of creation of the OMI. CreationDate string `mapstructure:"creation_date"` - // The AWS account ID of the owner. + // The Outscale account Id of the owner. Owner string `mapstructure:"owner"` // The owner alias. OwnerName string `mapstructure:"owner_name"` - // The key/value combination of the tags assigned to the AMI. + // The key/value combination of the tags assigned to the OMI. Tags map[string]string `mapstructure:"tags"` } diff --git a/docs-partials/datasource/omi/DatasourceOutput.mdx b/docs-partials/datasource/omi/DatasourceOutput.mdx new file mode 100644 index 00000000..add29d99 --- /dev/null +++ b/docs-partials/datasource/omi/DatasourceOutput.mdx @@ -0,0 +1,15 @@ + + +- `id` (string) - The ID of the OMI. + +- `name` (string) - The name of the OMI. + +- `creation_date` (string) - The date of creation of the OMI. + +- `owner` (string) - The Outscale account Id of the owner. + +- `owner_name` (string) - The owner alias. + +- `tags` (map[string]string) - The key/value combination of the tags assigned to the OMI. + + diff --git a/docs/datasources/omi.mdx b/docs/datasources/omi.mdx new file mode 100644 index 00000000..1a6f33f8 --- /dev/null +++ b/docs/datasources/omi.mdx @@ -0,0 +1,33 @@ +--- +description: | + The Outscale OMI data source provides information from an OMI that will be fetched based + on the filter options provided in the configuration. + +page_title: Outscale OMI - Data Source +nav_title: Outscale OMI +--- + +# Outscale OMI Data Source + +Type: `outscale-omi` + +The Outscale OMI Data source will filter and fetch an Outscale OMI, and output all the OMI information that will +be then available to use in the [Outscale builders](https://developer.hashicorp.com/packer/plugins/builders/outscale). + +-> **Note:** Data sources is a feature exclusively available to HCL2 templates. + +Basic example of usage: + +```hcl +data "outscale-omi" "basic-example" { + filters = { + virtualization-type = "hvm" + name = "ubuntu/images/*ubuntu-xenial-16.04-amd64-server-*" + root-device-type = "ebs" + } + owners = ["099720109477"] + most_recent = true +} +``` +This selects the most recent Ubuntu 16.04 HVM EBS OMI from Canonical. Note that the data source will fail unless +*exactly* one OMI is returned. In the above example, `most_recent` will cause this to succeed by selecting the newest image. \ No newline at end of file