如何在AWS Gateway中使用AWS Certificate Manager证书?

时间:2016-06-16 20:38:43

标签: amazon-web-services ssl-certificate aws-api-gateway

我需要# tf Graph input x = tf.placeholder("float", [None, n_steps, n_input]) y = tf.placeholder("float", [None, n_steps, n_classes]) # Define weights weights = { 'hidden': tf.Variable(tf.random_normal([n_hidden, n_classes]), dtype="float32"), 'out': tf.Variable(tf.random_normal([n_hidden, n_classes]), dtype="float32") } biases = { 'hidden': tf.Variable(tf.random_normal([n_hidden]), dtype="float32"), 'out': tf.Variable(tf.random_normal([n_classes]), dtype="float32") } def RNN(x, weights, biases): # Prepare data shape to match `rnn` function requirements # Current data input shape: (batch_size, n_steps, n_input) # Permuting batch_size and n_steps x = tf.transpose(x, [1, 0, 2]) # Reshaping to (n_steps*batch_size, n_input) x = tf.reshape(x, [-1, n_input]) # Split to get a list of 'n_steps' tensors of shape (batch_size, n_hidden) # This input shape is required by `rnn` function x = tf.split(0, n_steps, x) # Define a lstm cell with tensorflow lstm_cell = rnn_cell.BasicLSTMCell(n_hidden, forget_bias=1.0, state_is_tuple=True) outputs, states = rnn.rnn(lstm_cell, x, dtype=tf.float32) output_matrix = [] for i in xrange(n_steps): temp = tf.matmul(outputs[i], weights['out']) + biases['out'] # temp = tf.matmul(weights['hidden'], outputs[i]) + biases['hidden'] output_matrix.append(temp) pdb.set_trace() return output_matrix pred = RNN(x, weights, biases) # temp = RNN(x) # pdb.set_trace() # pred = tf.shape(temp) pred = tf.pack(tf.transpose(pred, [1,0,2])) cost = tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(pred, y)) Certificate nameCertificate bodyCertificate private key才能在API网关中使用域名。

我在亚马逊的证书管理器中拥有Certificate chain的证书。我想使用该证书信息。我无法从仪表板界面找到任何访问权限。有没有办法从AWS获取有关证书的信息?

2 个答案:

答案 0 :(得分:8)

从us-east-1区域创建的March 9th 2017证书可以由API网关使用。

AWS API网关不是service integrated with the AWS Certificate Manager。这仅限于使用这些服务(CloudFront和Elastic Load Balancing)。

要在API网关上安装SSL证书,您需要公共证书,私钥和根CA证书链。 ACM本身永远不会让您看到私钥,因为这是managed entirely within the service。这是一个限制因素:您无法以可用格式导出证书,以便以后导入到另一个SSL端点,例如API网关。

如果您正在测试,则需要从主要提供商处购买SSL证书,使用免费服务(StartSSL)或自签名证书。

使用这些证书中的任何一个,您都可以在API Gateway Create Custom Domain page.中配置它们

答案 1 :(得分:-1)

证书链是中级证书(中级证书)

对于证书链,请依次键入或粘贴PEM格式的中间证书和可选的根证书,不要有任何空行。如果包含根证书,则证书链必须以中间证书开头,并以根证书结束。使用证书颁发机构提供的中间证书。不包括任何不在信任链路径中的中间人。以下是缩写示例。

-----BEGIN CERTIFICATE-----
EXAMPLECA4ugAwIBAgIQWrYdrB5NogYUx1U9Pamy3DANBgkqhkiG9w0BAQUFADCB
...
8/ifBlIK3se2e4/hEfcEejX/arxbx1BJCHBvlEPNnsdw8EXAMPLE
-----END CERTIFICATE-----
Here is another example.

-----BEGIN CERTIFICATE-----
Intermediate certificate 2
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
Intermediate certificate 1
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
Optional: Root certificate
-----END CERTIFICATE-----

有关详细信息,请查看amazon developer guide