opsworks: impl create_instance
This commit is contained in:
parent
2fe5b77861
commit
09ca1b6e0c
3 changed files with 250 additions and 11 deletions
30
tests/test_opsworks/test_instances.py
Normal file
30
tests/test_opsworks/test_instances.py
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
from __future__ import unicode_literals
|
||||
import boto3
|
||||
import sure # noqa
|
||||
import re
|
||||
|
||||
from moto import mock_opsworks
|
||||
|
||||
@mock_opsworks
|
||||
def test_create_instance_response():
|
||||
client = boto3.client('opsworks')
|
||||
stack_id = client.create_stack(
|
||||
Name="test_stack_1",
|
||||
Region="us-east-1",
|
||||
ServiceRoleArn="service_arn",
|
||||
DefaultInstanceProfileArn="profile_arn"
|
||||
)['StackId']
|
||||
|
||||
layer_id = client.create_layer(
|
||||
StackId=stack_id,
|
||||
Type="custom",
|
||||
Name="TestLayer",
|
||||
Shortname="TestLayerShortName"
|
||||
)['LayerId']
|
||||
|
||||
response = client.create_instance(
|
||||
StackId=stack_id, LayerIds=[layer_id], InstanceType="t2.micro"
|
||||
)
|
||||
|
||||
response.should.contain("InstanceId")
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue