[英]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.