@@ -40,16 +40,30 @@ export class AwsProfileResource extends Resource<AwsProfileConfig> {
4040 csvCredentials : { type : 'directory' , setting : true } , // Type setting means it won't be included in the plan calculation
4141 output : { default : 'json' , canModify : true } ,
4242 profile : { default : 'default' , canModify : true } ,
43- metadataServiceNumAttempts : { canModify : true } ,
44- metadataServiceTimeout : { canModify : true } ,
43+ metadataServiceNumAttempts : { canModify : true , setting : true } ,
44+ metadataServiceTimeout : { canModify : true , setting : true } ,
4545 } ,
4646 transformation : CSVCredentialsTransformation ,
4747 importAndDestroy :{
48- refreshKeys : [ 'output' , 'profile' , 'awsAccessKeyId' , 'awsSecretAccessKey' , 'region' ] ,
4948 requiredParameters : [ 'profile' ]
5049 } ,
5150 allowMultiple : {
52- identifyingParameters : [ 'profile' ]
51+ identifyingParameters : [ 'profile' ] ,
52+ findAllParameters : async ( ) => {
53+ const $ = getPty ( ) ;
54+ const { status } = await $ . spawnSafe ( 'which aws' ) ;
55+ if ( status === 'error' ) {
56+ return [ ] ;
57+ }
58+
59+ const { data } = await $ . spawnSafe ( 'aws configure list-profiles' )
60+
61+ return data
62+ ?. split ( / \n / )
63+ ?. filter ( Boolean )
64+ ?. map ( ( profile ) => ( { profile } ) )
65+ ?? [ ] ;
66+ }
5367 }
5468 } ;
5569 }
0 commit comments