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

Update documentation for target_regions block #430

Closed
dhananjaipai opened this issue Jul 10, 2024 · 5 comments · Fixed by #437
Closed

Update documentation for target_regions block #430

dhananjaipai opened this issue Jul 10, 2024 · 5 comments · Fixed by #437
Labels
documentation Improvements or additions to documentation stage/accepted Confirmed, and intend to work on. No timeline commitment though.

Comments

@dhananjaipai
Copy link

Overview of the Issue

The documentation for target_regions does not specify the expected inputs in the block.
It just shows

target_region ([]TargetRegion) - A target region to store the image version in. ...

with no reference to what []TargetRegion is.

Reproduction Steps

Try setting target_region based on official docs and it does not work

The PR #387 seems to use replicas instead of regionalReplicaCount or regional_replica_count as expected, and there is no reference to this in the documentation.

Plugin and Packer version

From packer version 1.11.1

@lbajolet-hashicorp lbajolet-hashicorp added documentation Improvements or additions to documentation stage/accepted Confirmed, and intend to work on. No timeline commitment though. and removed bug labels Jul 15, 2024
@JenGoldstrich
Copy link
Contributor

JenGoldstrich commented Aug 22, 2024

Hey @dhananjaipai thanks for raising this issue

I have addressed the documentation issue and you can now see the target region docs here

@eugeneswalker
Copy link

eugeneswalker commented Aug 25, 2024

Hey @dhananjaipai thanks for raising this issue

I have addressed the documentation issue and you can now see the target regions docs here

If you search that page for "target_region" (singular, not plural) you should see there is still example HCL2 showing

shared_image_gallery_destination {
    ...
    target_region {
      name = "regionA"
    }
    target_region {
      name = "regionB"
    }
    target_region {
      name = "regionC"
    }
}

Does this need updating too @JenGoldstrich ?

@JenGoldstrich
Copy link
Contributor

@eugeneswalker I am not understanding what you are suggesting should be updated, can you please open a new issue describing what you think needs to be updated here and we'll address it as we're able

@eugeneswalker
Copy link

Reproduction Steps

Try setting target_region based on official docs and it does not work

This is still the case with the documentation linked in the first sentence of this issue:

Screenshot 2024-08-26 at 10 31 40 PM

To reproduce try using Packer 1.11.2 with this syntax:

shared_image_gallery_destination {
    ...
    target_region {
      name = "westus2"
    }
    target_region {
      name = "westus3"
    }
}

And you will get an error:

Blocks of type "target_region" are not expected here.

So, as the original issue says, if you use target_region based on the documentation it does not work...

@JenGoldstrich
Copy link
Contributor

JenGoldstrich commented Aug 27, 2024

OK so a few things here

I do not think the issue you are experiencing is the one that original issue author experienced, this issue was that the previous docs did not contain information on the sub fields of the target region block, now they do, the docs have changed which is why this issue specifically requesting the documentation updating is closed.

The author mentioned "it does not work" because they are referencing the docs before this issue was closed, which are different from how they are now.

This issue has nothing to do with any bugs there may be in the target_region block. The docs issue has been resolved and that's why you see docs about the target_region block.

Your error is most likely due to the Packer Azure Plugin version not the Packer version, the Packer Azure plugin is a distinct binary that is shipped and versioned separately from Packer. If you check the screenshot you can see the docs are versioned, you choose in that drop down what version of the plugin you want to view the docs of, you are referencing are for Packer Azure Plugin v2.1.8. The target_region field was released in v2.0.3 https://github.com/hashicorp/packer-plugin-azure/releases/tag/v2.0.3. Are you using a version of the Packer Azure plugin that exceeds v2.0.3?

Please confirm your version of the Packer Azure Plugin supports target_region, if you are on an Azure plugin version that supports it and still see this error please open a new issue, listing your plugin version and a minimum full Packer template to reproduce. A new issue is less likely to get lost in my inbox, and there are many community members who check issues and can often help as well, instead of pinging one person in a closed issue

Screenshot 2024-08-27 at 1 54 50 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation stage/accepted Confirmed, and intend to work on. No timeline commitment though.
Projects
None yet
4 participants