我在Github操作中运行AWS命令,我希望所有AWS API调用都针对一个虚拟对象运行.有什么想法吗



我调用了以下工作流:部署到_AWS.yml

在yml中,我使用:(配置我指向的帐户(

- name: Configure AWS credentials
id: config-aws-creds
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.THIS_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.THIS_AWS_SECRET_ACCESS_KEY }}
aws-region: eu-west-2

在那之后,我有许多不同的awscli命令,例如:

- name: Run cron ecs
run: |
subnets=`aws ssm get-parameter --name "xxx_ecs_subnet" | jq -r '.Parameter.Value'`
security_group=`aws ssm get-parameter --name "xxx_ecs_security_group_id" | jq -r '.Parameter.Value'`
aws ecs run-task --cluster xxx-cluster --task-definition xxx-cron --count 1 --launch-type FARGATE --network-configuration "awsvpcConfiguration={subnets=[$subnets],securityGroups=[$security_group]}"

我想使用此工具:(https://github.com/nektos/act)在本地运行Github操作,但我不希望进行真正的AWS调用。我过去有过使用名为moto的python库的经验,但我认为这不适用于CLI。

您是否可以选择性地传入&quot--干式运行";是否使用仅在本地运行时添加的参数或设置来标记?

最新更新