我正在尝试创建一个CI / CD管道,该管道将向Amazon AWS部署cloudformation模板。我想到了使用jenkins的AWS CLI来部署模板。
我的管道如下所示
pipeline {
agent any
stages {
stage('hello AWS') {
steps {
withAWS(role:'Jenkins',roleaccount:'XXXX8216610',duration:
900,roleSessionName: 'jenkins-session') {
sh 'aws cloudformation deploy --template-file
/path_to_template/template.json --stack-name my-new-stack '
但是这里的问题是我的Jenkins是本地部署的,所以我不能简单地创建和附加AWS角色来部署模板,也不能在工作中使用用户的凭证/访问密钥,因此我可以通过其他方式实现这个吗?