pulumi使用阿里云OSS存储后端状态

需要自行填充变量到脚本中

AWS的key和secret对应的是阿里云账号的key和secret,

#!/bin/sh

export OSS_REGION=
export AWS_ACCESS_KEY_ID=
export AWS_SECRET_ACCESS_KEY=

pulumi login "s3://dev-pulumi/?endpoint=oss-$OSS_REGION.aliyuncs.com&disableSSL=true&s3ForcePathStyle=false"

阿里云账号的权限策略示例

{
    "Version": "1",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "oss:PutObject",
                "oss:ListObjects",
                "oss:GetObject",
                "oss:DeleteObject"
            ],
            "Resource": [
                "acs:oss:*:*:dev",
                "acs:oss:*:*:dev/*"
            ]
        }
    ]

脚本示例

posted @ 2022-03-07 11:39  li66  阅读(107)  评论(0编辑  收藏  举报