简体   繁体   English

打包程序“source_ami_filter”中的“所有者”字段有何作用?

[英]what does "Owner" field in packer "source_ami_filter" work on?

i am new packer and exploring few things on it while using it something like this came up我是新包装工,在使用它时探索了一些东西,出现了这样的事情

"builders": [
    {
      "type": "amazon-ebs",
      "profile" : "sumanthdev",
      "region": "us-east-1",
      "source_ami_filter": {
        "filters": {
          "virtualization-type": "hvm",
          "name": "ubuntu/images/*ubuntu-xenial-16.04-amd64-server-*",
          "root-device-type": "ebs"
        },
        "owners": ["099720109477"],
        "most_recent": true
      },

I want to know what "owners": ["099720109477"], stands for.我想知道 "owners": ["099720109477"], 代表什么。 i know it takes input of an account id, but which?我知道它需要输入一个帐户 ID,但是哪个? the account id where it going to create the ami, or?它将创建 ami 的帐户 ID,或者?

This is to filter the AMIs, for those that are owned by a specific AWS account.这是为特定 AWS 账户所拥有的 AMI 过滤 AMI。 In this case this filter will only find images owned by the account id of 099720109477 that are named ubuntu/images/*ubuntu-xenial-16.04-amd64-server-* .在这种情况下,此过滤器将仅查找名为ubuntu/images/*ubuntu-xenial-16.04-amd64-server-*的帐户 ID 099720109477所拥有的图像。

Below from the documentation下面来自文档

Filters the images by their owner.按所有者过滤图像。 You may specify one or more AWS account IDs, "self" (which will use the account whose credentials you are using to run Packer), or an AWS owner alias: for example, amazon, aws-marketplace, or microsoft.您可以指定一个或多个 AWS 账户 ID、“self”(它将使用您用来运行 Packer 的凭据的账户)或 AWS 所有者别名:例如,amazon、aws-marketplace 或 microsoft。 This option is required for security reasons.出于安全原因,此选项是必需的。

"099720109477 is the account number for Canonical." “099720109477 是 Canonical 的帐号。” Source . 来源 (The comment below that one is also quite useful.) (那个下面的评论也很有用。)

Note that owners is also an optional parameter .请注意, owners也是一个可选参数

You may be looking for the ami_users field in order to share the AMI across accounts.您可能正在寻找ami_users字段以便跨账户共享 AMI。 ami_users is not a parameter in the source_ami_filter but instead can be found in the top-level of the source body, like so: ami_users不是source_ami_filter中的参数,而是可以在source正文的顶层找到,如下所示:

source "amazon-ebs" "dev-latest" {
  ami_name      = "dev-latest-${local.timestamp}"
  instance_type = "t2.micro"
  region        = var.region
  source_ami_filter {
    filters = {
      image-id            = "ami-03d5c68bab01f3496"
      root-device-type    = "ebs"
      virtualization-type = "hvm"
    }
    most_recent = true
    owners      = ["099720109477"]
  }
  ssh_username = "ubuntu"
  ami_users = ["777777777777", "888888888888", "999999999999"]
}

owners own the base AMI (layer) of the AMI you are making. owners拥有您正在创建的 AMI 的基础 AMI(层)。 ami_users are account numbers that the completed image is shared with. ami_users是完成图像共享的帐号。 After the AMI is "Available", you'll see output (at least with packer) that indicates it is modifying the privacy attributes of the completed image.在 AMI 为“可用”后,您将看到 output(至少对于加壳器而言)表明它正在修改已完成图像的隐私属性。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在packer ami数据源中添加区域 - How to add region in packer ami data source 源存储库无法在 pub/sub 上发布消息 - source repository does not work to publish messages on pub/sub buildspec、appspec 和滚动我自己的 AMI 之间有什么区别? - What's the difference between buildspec, appspec, and rolling my own AMI? Terrfaform - AWS_AMI 数据源不返回任何结果 - Terrfaform - AWS_AMI data source doesn't return any result ECS 代理是否需要 Amazon Linux AMI 才能运行? - Does ECS Agent require an Amazon Linux AMI in order to run? 加壳安全组查询 - Packer security group query “错误:禁止”http 控制台触发器不起作用,即使我是项目所有者 - "Error: Forbidden" http console trigger doesn't work even though I am the project owner Bash 脚本设置环境变量在使用源时不起作用,仅适用于 bash -c - Bash script to set env variables does not work when using source and only works with bash -c 使用 Packer 构建时出现身份验证错误 - Authentication Error on Building with Packer 为 AWS AMI 编译 libgdal 失败 - Compiling libgdal for AWS AMI fails
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM