aws / apprunner-roadmap

This is the public roadmap for AWS App Runner.
https://aws.amazon.com/apprunner/
Other
298 stars 14 forks source link

Support a describeConnection API. #171

Open kouwasi opened 1 year ago

kouwasi commented 1 year ago

Community Note

Tell us about your request Want you to provide describeConnection API, like a describeService API.

In my case, I'm controlling App Runner Connection by custom resource in CDK. When I update some CFn's resources, Need to implement onUpdate behaviour in custom resource.

An example below.

new AwsCustomResource(this, 'GitHubConnection', {
  onCreate: {
    service: 'AppRunner',
    action: 'createConnection',
    parameters: {
      ConnectionName: 'my-connection',
      ProviderType: 'GITHUB'
    },
    physicalResourceId: cr.PhysicalResourceId.fromResponse('Connection.ConnectionArn')
  },
  onUpdate: {
    service: 'AppRunner',
    action: 'describeConnection',
    parameters: {
      ConnectionName: 'my-connection', // Connection ARN?
    },
    physicalResourceId: cr.PhysicalResourceId.fromResponse('Connection.ConnectionArn')
  },
  onDelete: {
    service: 'AppRunner',
    action: 'deleteConnection',
    parameters: {
      ConnectionArn: new cr.PhysicalResourceIdReference()
    },
  },
  policy: cr.AwsCustomResourcePolicy.fromSdkCalls({
    resources: cr.AwsCustomResourcePolicy.ANY_RESOURCE
  })
})

const connectionArn = connection.getResponseField('Connection.ConnectionArn')

Describe alternatives you've considered I've tryed to use ListConnections and describeService API. However I don't know how to use it in custom resource.

I think can't use these apis. Because these response does not comatiple to createConnection response. These responses body structure is need to same. It means, if not specified key does not exists, The getResponseField method throws an error.

That why I submitted a feature request.