Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Add Codepipeline action region support #7866

Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions aws/resource_aws_codepipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,11 @@ func resourceAwsCodePipeline() *schema.Resource {
Optional: true,
Computed: true,
},
"region": {
Type: schema.TypeString,
Optional: true,
Computed: true,
},
},
},
},
Expand Down Expand Up @@ -313,6 +318,10 @@ func expandAwsCodePipelineActions(s []interface{}) []*codepipeline.ActionDeclara
if ro > 0 {
action.RunOrder = aws.Int64(int64(ro))
}
r := data["region"].(string)
if r != "" {
action.Region = aws.String(r)
}
actions = append(actions, &action)
}
return actions
Expand Down Expand Up @@ -354,6 +363,10 @@ func flattenAwsCodePipelineStageActions(actions []*codepipeline.ActionDeclaratio
values["run_order"] = int(*action.RunOrder)
}

if action.Region != nil {
values["region"] = *action.Region
}

actionsList = append(actionsList, values)
}
return actionsList
Expand Down
1 change: 1 addition & 0 deletions website/docs/r/codepipeline.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ A `action` block supports the following arguments:
* `output_artifacts` - (Optional) A list of artifact names to output. Output artifact names must be unique within a pipeline.
* `role_arn` - (Optional) The ARN of the IAM service role that will perform the declared action. This is assumed through the roleArn for the pipeline.
* `run_order` - (Optional) The order in which actions are run.
* `region` - (Optional) The region in which to run the action.

~> **Note:** The input artifact of an action must exactly match the output artifact declared in a preceding action, but the input artifact does not have to be the next action in strict sequence from the action that provided the output artifact. Actions in parallel can declare different output artifacts, which are in turn consumed by different following actions.

Expand Down