-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request juju#13490 from tlm/aws-instance-profile
juju#13490 This commit adds support instance profiles auto creation. Including the associated role and policy needed to scope permissions correctly. Accompanying this PR is also a discourse doc on the permissions Juju requires when talking with AWS. ## QA steps ```sh juju bootstrap --bootstrap-constraints="instance-role=auto" aws/ap-southeast-2 test-tlm-controller ``` You then need to confirm with the aws cli that the associated instance profile elements were created. Make sure that you see a role with the same here attached to the instance profile. ```sh aws iam get-instance-profile --instance-profile-name juju-controller-test-tlm-controller ``` Add some machines to Juju and deploy a charm with storage to confirm permissions are operating correctly. Check HA works ``` $ juju enable-ha juju enable-ha maintaining machines: 0 adding machines: 1, 2 $ juju status Model Controller Cloud/Region Version SLA Timestamp controller test-tlm-controller aws/ap-southeast-2 2.9.20.1 unsupported 09:34:28+10:00 Machine State DNS Inst id Series AZ Message 0 started 13.211.59.65 i-f00f00f00f00f00f00 focal ap-southeast-2b running 1 pending pending focal attaching aws instance profile arn:aws:iam::123456789:instance-profile/juju-controller-test-tlm-controller 2 pending pending focal attaching aws instance profile arn:aws:iam::123456789:instance-profile/juju-controller-test-tlm-controller ``` Check destroy-controller works ``` $ juju destroy-controller test-tlm-controller --destroy-all-models ``` ## Documentation changes Permission list: https://discourse.charmhub.io/t/juju-aws-permissions/5307 Doc Link: https://discourse.charmhub.io/t/using-aws-instance-profiles-with-juju-2-9/5185/3 ## Bug reference N/A
- Loading branch information
Showing
16 changed files
with
713 additions
and
227 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Copyright 2021 Canonical Ltd. | ||
// Licensed under the AGPLv3, see LICENCE file for details. | ||
|
||
package environs | ||
|
||
import ( | ||
"github.com/juju/juju/environs/context" | ||
) | ||
|
||
const ( | ||
// InstanceProfileAutoCreate defines the const value used for the constraint | ||
// when instance profile creation should be done on behalf of the user. | ||
InstanceProfileAutoCreate = "auto" | ||
) | ||
|
||
// InstanceRole defines the interface for environ providers to implement when | ||
// they offer InstanceRole support for their respective cloud. | ||
type InstanceRole interface { | ||
// CreateAutoInstanceRole is responsible for setting up an instance role on | ||
// behalf of the user. | ||
CreateAutoInstanceRole(context.ProviderCallContext, BootstrapParams) (string, error) | ||
|
||
// SupportsInstanceRoles indicates if Instance Roles are supported by this | ||
// environ. | ||
SupportsInstanceRoles(context.ProviderCallContext) bool | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.